Skip to content

Compiling with gcc 15 and UNREACHABLE_CODE, NORETURN errors #338

Description

@andreasbaumann

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions