Skip to content

common_types: don't typedef bool on C23 compilers#37

Open
runlevel5 wants to merge 1 commit into
open-power:masterfrom
runlevel5:fix-c23-bool-typedef
Open

common_types: don't typedef bool on C23 compilers#37
runlevel5 wants to merge 1 commit into
open-power:masterfrom
runlevel5:fix-c23-bool-typedef

Conversation

@runlevel5

Copy link
Copy Markdown
Contributor

In C23 (GCC 14+ defaults to -std=gnu23) bool is a built-in keyword, so the typedef uint8_t bool; in common_types.h is now a hard error ("two or more data types in declaration specifiers") when host build tools such as imageHdrScript are compiled with a modern host gcc.

Guard the typedef on STDC_VERSION so it is kept for pre-C23 compilers and the PPE42 cross-toolchain, but skipped on C23+ where bool is already defined.

In C23 (GCC 14+ defaults to -std=gnu23) bool is a built-in keyword, so
the `typedef uint8_t bool;` in common_types.h is now a hard error
("two or more data types in declaration specifiers") when host build
tools such as imageHdrScript are compiled with a modern host gcc.

Guard the typedef on __STDC_VERSION__ so it is kept for pre-C23
compilers and the PPE42 cross-toolchain, but skipped on C23+ where
bool is already defined.

Signed-off-by: Trung Lê <8@tle.id.au>
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