mirror of
https://github.com/qmk/qmk_firmware.git
synced 2026-06-03 14:13:46 -03:00
GCC 16.1 compatibility fix. (#26216)
Co-authored-by: Joel Challis <git@zvecr.com>
This commit is contained in:
@@ -72,6 +72,8 @@ endif
|
|||||||
endif
|
endif
|
||||||
CFLAGS += -Wall
|
CFLAGS += -Wall
|
||||||
CFLAGS += -Wstrict-prototypes
|
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)
|
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
|
||||||
CFLAGS += -Werror
|
CFLAGS += -Werror
|
||||||
endif
|
endif
|
||||||
@@ -89,7 +91,8 @@ CXXFLAGS += -O$(OPT)
|
|||||||
CXXFLAGS += -w
|
CXXFLAGS += -w
|
||||||
CXXFLAGS += -Wall
|
CXXFLAGS += -Wall
|
||||||
CXXFLAGS += -Wundef
|
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)
|
ifneq ($(strip $(ALLOW_WARNINGS)), yes)
|
||||||
CXXFLAGS += -Werror
|
CXXFLAGS += -Werror
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
# $(2) = option to use if $(1) is not supported
|
# $(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
|
# $(3) = additional arguments to pass to the compiler during the test, but aren't contained in the output
|
||||||
cc-option = $(shell \
|
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)
|
then echo "$(1)"; else echo "$(2)"; fi)
|
||||||
|
|
||||||
# Helper to pass comma character to make functions (use with `$(,)` to pass in `$(call ...)` arguments)
|
# Helper to pass comma character to make functions (use with `$(,)` to pass in `$(call ...)` arguments)
|
||||||
|
|||||||
Reference in New Issue
Block a user