Skip to content

Compilation failure with GCC 15 + cmake - bool is now a keyword (C23+) #490

@rbanffy

Description

@rbanffy

When attempting to compile OpenSimH with GNU C++ 15.2.1 (Fedora 42) using the cmake script, I got the following failure:

In file included from /simh/slirp/slirp.h:4,
                 from /simh/slirp/arp_table.c:25:
/simh/slirp_glue/config-host.h:15:13: error: ‘bool’ cannot be defined via ‘typedef’
   15 | typedef int bool;
      |             ^~~~
/simh/slirp_glue/config-host.h:15:13: note: ‘bool’ is a keyword with ‘-std=c23’ onwards
/simh/slirp_glue/config-host.h:15:1: warning: useless type name in empty declaration
   15 | typedef int bool;
      | ^~~~~~~
gmake[2]: *** [slirp/CMakeFiles/slirp.dir/build.make:79: slirp/CMakeFiles/slirp.dir/arp_table.c.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:2645: slirp/CMakeFiles/slirp.dir/all] Error 2
gmake: *** [Makefile:166: all] Error 2
*** cmake/cmake-builder.sh: Build errors detected. Exiting.

We can either dig into the source and fix it in a portable way, or ask the GNU compiler to check against a less strict standard.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions