Skip to content

Conversation

deuill
Copy link
Contributor

@deuill deuill commented Sep 4, 2025

GCC 15 has been released (fairly) recently, and with it come C23 features such as built-in bool types, which obviate the need for defining these in each code-base.

In our case, this also causes compilation errors with GCC 15 (unless the -std=gnu17 flag is passed), e.g.:

./test.go:16:17: error: two or more data types in declaration specifiers
   16 | typedef uint8_t bool;
      |                 ^~~~

This commit wraps these typedef declarations in __STDC_VERSION__ checks, skipping if the version is C23 or over.

GCC 15 has been released (fairly) recently, and with it come C23
features such as built-in `bool` types, which obviate the need for
defining these in each code-base.

In our case, this also causes compilation errors with GCC 15 (unless the
`-std=gnu17` flag is passed), e.g.:

  ./test.go:16:17: error: two or more data types in declaration specifiers
     16 | typedef uint8_t bool;
        |                 ^~~~

This commit wraps these `typedef` declarations in `__STDC_VERSION__`
checks, skipping if the version is C23 or over.
@deuill deuill force-pushed the c23-fix-compilation branch from 8be0b88 to 0e657f8 Compare September 4, 2025 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant