Open zalsaeed opened 1 year ago
It looks like you have found a compiler bug. In C, partial initialization of struct is possible, and the uninitialized members are zeroed. So creating a full zero data with = { 0 }
is possible regardless of struct.
I see that others were able to build JerryScript with newer versions of clang (thus it seems fixed for newer versions). Clang 3.8 is not going to change. Thus there are two possible fixes here.
Luckily there was only two initialization that required changes.
ecma_typedarray_info_t info = { 0,0,0,0,0,0 };
scanner_range_t range = { 0,{0,0,0} };
I didn't put these in a pull request as it would require running tests on several other environments (which I don't have) to ensure it is still compatible. And I'm not actively working on JerryScript. However, feel free to apply them if you find this acceptable.
Unfortunately, I cannot find the proper way to apply such flags with the python build script. Any help here is highly appreciated.
My problem is solved for now. Please feel free to close this issue if the changes are not going to be applied.
Brief Description & Steps
Failed to build on Debian with Clang 3.8. In the same environment the build succeeds with cc/gcc, but not with the version of clang used . This is the error I'm getting
error: missing field 'id' initializer [-Werror,-Wmissing-field-initializers]
onecma-builtin-typedarray-prototype.c:1922:37
. Below is the full detail of the error and how to regenerate it.JerryScript revision
368641043fc9580400a179669f9b45782db90538
Build platform
Debian GNU/Linux 9 (stretch) - (Linux 5.10.104-linuxkit x86_64)
clang version 3.8.1-24 (tags/RELEASE_381/final)
Build steps
Partial Build Stdout
Dockerfile to Rebuild the same Environment
Dockerfile
Build Docker Image
Run Docker Container
Complete Log
CMakeOutput.log
CMakeError.log