Skip to content

Commit 59ff488

Browse files
committed
Merge branch 'ps/clang-w-glibc-2.43-and-_Generic'
Headers from glibc 2.43 when used with clang does not allow disabling C11 language features, causing build failures.. * ps/clang-w-glibc-2.43-and-_Generic: build: tolerate use of _Generic from glibc 2.43 with Clang
2 parents 29bd7ed + 0a6d290 commit 59ff488

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

config.mak.dev

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@ endif
9898
endif
9999
endif
100100

101+
# glibc 2.43 headers unconditionally use _Generic even when we ask the
102+
# compiler to stick to -std=gnu99 and unlike GCC, clang lacks a
103+
# workaround to squelch warnings from system headers.
104+
ifneq ($(filter clang1,$(COMPILER_FEATURES)),) # if we are using clang
105+
DEVELOPER_CFLAGS += -Wno-c11-extensions
106+
endif
107+
101108
# https://bugzilla.redhat.com/show_bug.cgi?id=2075786
102109
ifneq ($(filter gcc12,$(COMPILER_FEATURES)),)
103110
DEVELOPER_CFLAGS += -Wno-error=stringop-overread

meson.build

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,12 @@ if get_option('warning_level') in ['2','3', 'everything'] and compiler.get_argum
866866
libgit_c_args += cflag
867867
endif
868868
endforeach
869+
870+
# Clang generates warnings when compiling glibc 2.43 because of the use of
871+
# _Generic.
872+
if compiler.get_id() == 'clang'
873+
libgit_c_args += '-Wno-c11-extensions'
874+
endif
869875
endif
870876

871877
if get_option('breaking_changes')

0 commit comments

Comments
 (0)