From: Paul Eggert Date: Sun, 7 Sep 2025 23:34:43 +0000 (-0700) Subject: maint: allow false/true in C macros X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d041f83c60240db782663908da219fc1144915f;p=thirdparty%2Fgnulib.git maint: allow false/true in C macros * top/maint.mk (sc_Wundef_boolean): Allow false and true in C macro definiens. C23 requires support for false and true, and the ‘bool’ module makes it easy to support this in older compilers. --- diff --git a/ChangeLog b/ChangeLog index 2ff90ef8b7..0c132816f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-09-07 Paul Eggert + + maint: allow false/true in C macros + * top/maint.mk (sc_Wundef_boolean): Allow false and true in C + macro definiens. C23 requires support for false and true, and the + ‘bool’ module makes it easy to support this in older compilers. + 2025-09-07 Bruno Haible bootstrap: Improve efficiency of "git clone". diff --git a/top/maint.mk b/top/maint.mk index e03e887cba..1a6511b4f8 100644 --- a/top/maint.mk +++ b/top/maint.mk @@ -1454,10 +1454,13 @@ sc_prohibit_reversed_compare_failure: # That would be flagged by using -Wundef, however gnulib currently # tests many undefined macros, and so we can't enable that option. # So at least preclude common boolean strings as macro values. +# Although this rule formerly also complained about 'true' and 'false', +# that complaint is now incorrect given that C23 has blessed this practice +# and the 'bool' module supports it. sc_Wundef_boolean: - @prohibit='^#define.*(yes|no|true|false)$$' \ + @prohibit='^#define.*(yes|no)$$' \ in_files='$(CONFIG_INCLUDE)' \ - halt='Use 0 or 1 for macro values' \ + halt='Use 0/1 or false/true for macro values' \ $(_sc_search_regexp) # Even if you use pathmax.h to guarantee that PATH_MAX is defined, it might