-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
redefinition of typedef ‘NIM_STATIC_ASSERT_AUX’ in x32 #17247
Comments
@h4cnull PR welcome |
I back up lib/nimbash.h and add comment these lines,error fixed。 323 //NIM_STATIC_ASSERT(sizeof(NIM_BOOL) == 1, ""); // check whether really needed |
I'm able to reproduce the issue by using gcc 4.1 or 4.2:
|
fixes nim-lang#17247 This generates a new NIM_STATIC_ASSERT_AUX variable for each line that NIM_STATIC_ASSERT is called from. While this can solve all existing issues in the current code base, this method is not effective for multiple asserts on a single line.
I try to use musl-gcc build a 32bit file。
system: centos6.8 i386
command: nim --gcc.exe:musl-gcc --gcc.linkerexe:musl-gcc --passL:-static -d:release -d:danger -d:strip --opt:size c xxx.nim
error out:
Hint: used config file '/opt/nim/config/nim.cfg' [Conf]
Hint: used config file '/opt/nim/config/config.nims' [Conf]
...............................................
Hint: musl-gcc -c -w -fmax-errors=3 -Os -fno-ident -I/opt/nim/lib -I/root -o /root/.cache/nim/xxx_r/stdlib_assertions.nim.c.o /root/.cache/nim/xxx_r/stdlib_assertions.nim.c [Exec]
In file included from /root/.cache/nim/xxx_r/stdlib_assertions.nim.c:12:
/opt/nim/lib/nimbase.h:542: error: redefinition of typedef ‘NIM_STATIC_ASSERT_AUX’
/opt/nim/lib/nimbase.h:323: note: previous declaration of ‘NIM_STATIC_ASSERT_AUX’ was here
Error: execution of an external program failed: 'musl-gcc -c -w -fmax-errors=3 -Os -fno-ident -I/opt/nim/lib -I/root -o /root/.cache/nim/xxx_r/stdlib_assertions.nim.c.o /root/.cache/nim/xxx_r/stdlib_assertions.nim.c'
The text was updated successfully, but these errors were encountered: