diff --git a/config.mak.dev b/config.mak.dev index c8dcf78779..eecb12c111 100644 --- a/config.mak.dev +++ b/config.mak.dev @@ -98,6 +98,13 @@ endif endif endif +# glibc 2.43 headers unconditionally use _Generic even when we ask the +# compiler to stick to -std=gnu99 and unlike GCC, clang lacks a +# workaround to squelch warnings from system headers. +ifneq ($(filter clang1,$(COMPILER_FEATURES)),) # if we are using clang +DEVELOPER_CFLAGS += -Wno-c11-extensions +endif + # https://bugzilla.redhat.com/show_bug.cgi?id=2075786 ifneq ($(filter gcc12,$(COMPILER_FEATURES)),) DEVELOPER_CFLAGS += -Wno-error=stringop-overread diff --git a/meson.build b/meson.build index 098345ec52..de917bcf11 100644 --- a/meson.build +++ b/meson.build @@ -866,6 +866,12 @@ if get_option('warning_level') in ['2','3', 'everything'] and compiler.get_argum libgit_c_args += cflag endif endforeach + + # Clang generates warnings when compiling glibc 2.43 because of the use of + # _Generic. + if compiler.get_id() == 'clang' + libgit_c_args += '-Wno-c11-extensions' + endif endif if get_option('breaking_changes')