diff --git a/config.mak.dev b/config.mak.dev index 8830b78c1b552f..eecb12c1111ff4 100644 --- a/config.mak.dev +++ b/config.mak.dev @@ -21,15 +21,12 @@ endif endif ifneq ($(uname_S),FreeBSD) -ifneq ($(filter gcc6,$(COMPILER_FEATURES)),) +ifneq ($(or $(filter gcc6,$(COMPILER_FEATURES)),$(filter clang7,$(COMPILER_FEATURES))),) DEVELOPER_CFLAGS += -std=gnu99 endif else # FreeBSD cannot limit to C99 because its system headers unconditionally # rely on C11 features. -# -# Clang cannot limit to C99 when using glibc 2.43 because its system headers -# depend on the _Generic C11 feature. This works with GCC though. endif DEVELOPER_CFLAGS += -Wdeclaration-after-statement @@ -101,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