Please refer to this gist for the test source code: https://gist.github.com/4063456
This file works correctly when compiling directly using clang:
$ clang va-args-bug.c
$ ./a.out
The original address of a is: 0x12345678
The original type of b is: 9
The current address of a is: 0x12345678
The current type of b is: 9
But if we use emscripten to compile it, the results are not correct:
$ ./emcc va-args-bug.c
$ node a.out.js
The original address of a is: 0x12345678
The original type of b is: 9
The current address of a is: 0x10
The current type of b is: 24
This is very likely to be the reason of Issue #689. But I'm not 100% sure about this.
Please refer to this gist for the test source code: https://gist.github.com/4063456
This file works correctly when compiling directly using clang:
But if we use emscripten to compile it, the results are not correct:
This is very likely to be the reason of Issue #689. But I'm not 100% sure about this.