[PATCH 2/9] scripts: Check multiple inclusion in check-installed-headers.sh
Carlos O'Donell
carlos@redhat.com
Mon Nov 2 16:55:51 GMT 2026
On 10/21/26 9:54 AM, Adhemerval Zanella wrote:
> Include each header twice so a missing or broken multiple inclusion
> guard is reported (for instance, sys/pidfd.h did not define _PIDFD_H).
>
> The redefinition is only diagnosed for C++ and C standards prior to C23,
> since C23 allows a compatible redefinition of a tag type. Both are
> already covered by the c_modes and cxx_modes.
>
> Checked on aarch64-linux-gnu.
> ---
> scripts/check-installed-headers.sh | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/scripts/check-installed-headers.sh b/scripts/check-installed-headers.sh
> index 84b4be33278..c82d452ae2c 100644
> --- a/scripts/check-installed-headers.sh
> +++ b/scripts/check-installed-headers.sh
> @@ -128,6 +128,8 @@ $fortify_mode
> ensure that this selection wins. */
> $expanded_lib_mode
> #include <$header>
> +/* Check that the header is protected against multiple inclusion. */
> +#include <$header>
LGTM.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
> int avoid_empty_translation_unit;
> EOF
> if $cc_cmd -fsyntax-only $lang_mode "$cih_test_c" 2>&1
--
Cheers,
Carlos.
More information about the Libc-alpha
mailing list