GCC 16.1 compatibility fix. (#26216)

Co-authored-by: Joel Challis <git@zvecr.com>
This commit is contained in:
Nick Brassel
2026-05-17 13:06:47 +10:00
committed by GitHub
parent 504533b3b4
commit 1836382f66
2 changed files with 5 additions and 2 deletions
+4 -1
View File
@@ -72,6 +72,8 @@ endif
endif
CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes
CFLAGS += $(call cc-option,-Wunused-but-set-variable=1,-Wunused-but-set-variable)
CFLAGS += $(call cc-option,-Wunused-but-set-parameter=1,-Wunused-but-set-parameter)
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
CFLAGS += -Werror
endif
@@ -89,7 +91,8 @@ CXXFLAGS += -O$(OPT)
CXXFLAGS += -w
CXXFLAGS += -Wall
CXXFLAGS += -Wundef
CXXFLAGS += $(call cc-option,-Wunused-but-set-variable=1,-Wunused-but-set-variable)
CXXFLAGS += $(call cc-option,-Wunused-but-set-parameter=1,-Wunused-but-set-parameter)
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
CXXFLAGS += -Werror
endif
+1 -1
View File
@@ -4,7 +4,7 @@
# $(2) = option to use if $(1) is not supported
# $(3) = additional arguments to pass to the compiler during the test, but aren't contained in the output
cc-option = $(shell \
if { echo 'int main(){return 0;}' | $(CC) $(1) $(3) -o /dev/null -x c /dev/null >/dev/null 2>&1; }; \
if { echo 'int main(){return 0;}' | $(CC) $(1) $(3) -Wl,--unresolved-symbols=ignore-all -o /dev/null -x c /dev/null >/dev/null 2>&1; }; \
then echo "$(1)"; else echo "$(2)"; fi)
# Helper to pass comma character to make functions (use with `$(,)` to pass in `$(call ...)` arguments)