Skip to content

fix(arch): guard stdbool.h shims against C23 keyword conflict - #196

Open
thecapn32 wants to merge 1 commit into
YuzukiHD:mainfrom
thecapn32:fix/stdbool-c23-keyword-conflict
Open

fix(arch): guard stdbool.h shims against C23 keyword conflict#196
thecapn32 wants to merge 1 commit into
YuzukiHD:mainfrom
thecapn32:fix/stdbool-c23-keyword-conflict

Conversation

@thecapn32

Copy link
Copy Markdown

GCC 15 defaults to -std=gnu23, where bool/true/false are language
keywords. The arm32 and riscv stdbool.h shims unconditionally
redefined them via enum/typedef, which fails to compile under C23.

  • Only define bool/true/false when the compiler doesn't already
    provide them as C23 keywords, and skip entirely under C++
  • Use #define bool _Bool (the real builtin type) instead of a
    typedef'd int8_t lookalike, matching glibc/newlib's stdbool.h
  • Add the standard __bool_true_false_are_defined guard macro

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