You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Compiling with gcc 15 and UNREACHABLE_CODE, NORETURN errors #338
Seems newer compilers can actually reach UNREACHABLE_CODE and complain about
it not being defined anywhere (on Archlinux, gcc 15.2.1):
util/LLgen/src/gencode.c: In function ‘prset’:
util/LLgen/src/gencode.c:463:9: error: ‘UNREACHABLE_CODE’ undeclared (first use in this function)
463 | UNREACHABLE_CODE;
| ^~~~~~~~~~~~~~~~
util/LLgen/src/gencode.c:463:9: note: each undeclared identifier is reported only once for each function it appears in
[27/9927] HOSTCC util/LLgen/+LLgen/util/LLgen/src/LLgen.c
Also there are warnings about NORETURN:
In file included from modules/src/data/warnings.c:4:
.obj/modules/src/data/+data_hdr/warnings.h:7:16: error: expected ‘;’ before ‘void’
7 | extern NORETURN void fatal(const char* fmt, ...);
| ^~~~~
| ;
I was able to build it with minimal (actually no) code changes by setting::
make CFLAGS='-DUNREACHABLE_CODE="__builtin_unreachable()" -DNORETURN="__attribute__((noreturn))"'
Not sure, if this needs any real fix inside the code itself. Maybe it's enough that other
people see a workaround in this bug when building with newer compilers?
changed the title [-]Compiling with gcc 15 and UNREACHABLE_CODE, UNUSED errors[/-][+]Compiling with gcc 15 and UNREACHABLE_CODE, NORETURN errors[/+]on Sep 4, 2025
You don't have CFLAGS defined in the environment, do you? If so, that'll be overriding the definition in the Makefile. I should change it so that the two necessary defines are always added to CFLAGS.
Activity
[-]Compiling with gcc 15 and UNREACHABLE_CODE, UNUSED errors[/-][+]Compiling with gcc 15 and UNREACHABLE_CODE, NORETURN errors[/+]davidgiven commentedon Sep 4, 2025
You don't have CFLAGS defined in the environment, do you? If so, that'll be overriding the definition in the Makefile. I should change it so that the two necessary defines are always added to CFLAGS.
andreasbaumann commentedon Sep 4, 2025
I'm explicitely overwriting them (because of something else):
https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ack-git#n29
davidgiven commentedon Sep 4, 2025
After some fiddling, the magic in the Makefile is:
But really the two special definitions should be added in the build.py. I'll fix that.
andreasbaumann commentedon Sep 4, 2025
Ok, thanks. :-)