runno
runno copied to clipboard
Error when including stdlib.h Clang
The program will fail to compile if stdlib.h
is included.
Three errors occur all appearing to do with wchar_t
In file included from program:2:
/sys/include/stdlib.h:83:13: error: unknown type name 'wchar_t'
int mbtowc (wchar_t *__restrict, const char *__restrict, size_t);
^
/sys/include/stdlib.h:85:18: error: unknown type name 'wchar_t'
size_t mbstowcs (wchar_t *__restrict, const char *__restrict, size_t);
^
/sys/include/stdlib.h:86:42: error: unknown type name 'wchar_t'
size_t wcstombs (char *__restrict, const wchar_t *__restrict, size_t);
Example here.
I tried compiling the code using wasm-clang directly and it seems to have worked so I'm not sure what the issue is.
If you switch to the clangpp
runtime this seems to work fine. The clang
available on WAPM (https://wapm.io/syrusakbary/clang) had a bunch of issues with C++ so I fixed them in runno-clang
(https://wapm.io/taybenlor/runno-clang) by copying wasm-clang
. This could probably be fixed by switching uses of clang
in the C runtime to runno-clang
(PR welcome!).
This is fixed by the new runtime in v0.4.2