Elyes Haouas has submitted this change. ( https://review.coreboot.org/c/coreboot/+/83909?usp=email )
Change subject: include/stdbool: Don't unconditionally typedef bool ......................................................................
include/stdbool: Don't unconditionally typedef bool
When compiling with the C23 standard, bool, true, and false are pre-defined by the language, so defining them in stdbool.h isn't allowed. This fixes the following error: src/include/stdbool.h:6:17: error: two or more data types in declaration specifiers 6 | typedef _Bool bool; | ^~~~ src/include/stdbool.h:6:1: error: useless type name in empty declaration [-Werror] 6 | typedef _Bool bool; | ^~~~~~~
Change-Id: Iec9b4e3f308008ece773ce3460daff97370161ea Signed-off-by: Elyes Haouas ehaouas@noos.fr Reviewed-on: https://review.coreboot.org/c/coreboot/+/83909 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Nico Huber nico.h@gmx.de --- M src/include/stdbool.h 1 file changed, 4 insertions(+), 2 deletions(-)
Approvals: Nico Huber: Looks good to me, approved build bot (Jenkins): Verified
diff --git a/src/include/stdbool.h b/src/include/stdbool.h index 3733527..bfb997a 100644 --- a/src/include/stdbool.h +++ b/src/include/stdbool.h @@ -3,8 +3,10 @@ #ifndef __STDBOOL_H__ #define __STDBOOL_H__
+#if __STDC_VERSION__ <= 201710L typedef _Bool bool; -#define true 1 -#define false 0 +#define true 1 +#define false 0 +#endif
#endif /* __STDBOOL_H__ */