emscripten-core / emscripten-core/emscripten

`FS_readFile` is not listed in `runtimeElements`

Open
#19,863 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
27.6k
Forks
3.6k
Avg merge
1d 1h
Merged PRs (30d)
105

Description

Looking into the `runtimeElements`, the `FS_readFile` is not listed at the possible exportable names here.
https://github.com/emscripten-core/emscripten/blob/f51ae7f00792bcb9d4af7c8fcb73d305f899ba7a/src/modules.js#L362

But it can be exported with warning if it is specified by like this
```
emcc ... -s EXPORTED_RUNTIME_METHODS='["FS_readFile"]' ...
warning: invalid item in EXPORTED_RUNTIME_METHODS: FS_readFile
```
The generated js file has Module["FS_readFile"] entry and it is completely working correct.
So I wonder this is spec or bug.

I hope the `runtimeElements` is just lacking the entry of `FS_readFile` because it is not harmful for everyone.
How about to add it in the list?

**Version of emscripten/emsdk:**
```
emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.43 (a6b8143cf3c1171db911750359456b15a8deece7)
clang version 17.0.0 (https://github.com/llvm/llvm-project 71513a71cdf380efd6a44be6939e2cb979a62407)
Target: wasm32-unknown-emscripten
Thread model: posix
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.