Attention is currently required from: Elyes Haouas.
Nico Huber has posted comments on this change by Elyes Haouas. ( https://review.coreboot.org/c/coreboot/+/83909?usp=email )
Change subject: include/stdbool: Don't unconditionally typedef bool ......................................................................
Patch Set 7:
(1 comment)
File src/include/stdbool.h:
https://review.coreboot.org/c/coreboot/+/83909/comment/efdcda38_44860369?usp... : PS7, Line 7: #ifndef bool
If I remember well, OpenSBI unconditionally typedef bool and I found it somehow stupid (3rdparty/ope […]
I don't fully understand, sorry. What <sbi/sbi_types.h> does is *not* compatible in any way to <stdbool.h>. The latter is supposed to provide `bool` for older versions of C. Which makes the first `#if __STDC_VERSION___...` the right thing to do, IMO.
But ignoring a pre-defined `bool` for older versions of C seems quite dangerous, and I think <sbi/sbi_types.h> proves that: They use `int` as `bool` which has different semantics. If we'd allow to mix the two header files in some coreboot code, the compiled assembly for that file would be incompatible to the rest of coreboot (beside that we'd lose the special semantics of `_Bool` locally). Without the `ifdef bool`, OTOH, I guess the compiler would correctly bail out so we don't get a subtly broken coreboot.