diff --git a/cpu/esp32/Makefile.include b/cpu/esp32/Makefile.include index b25383e847b5..1b2c85c7fff6 100644 --- a/cpu/esp32/Makefile.include +++ b/cpu/esp32/Makefile.include @@ -105,6 +105,10 @@ CFLAGS += -DLOG_TAG_IN_BRACKETS CFLAGS += -Wno-unused-parameter -Wformat=0 CFLAGS += -mlongcalls -mtext-section-literals -fstrict-volatile-bitfields CFLAGS += -fdata-sections -ffunction-sections -fzero-initialized-in-bss + +OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow +OPTIONAL_CFLAGS_BLACKLIST += -Wformat-truncation + ASFLAGS += --longcalls --text-section-literals ifneq ($(CONFIGS),) diff --git a/cpu/esp8266/Makefile.include b/cpu/esp8266/Makefile.include index 469f86cb8333..55915b0e5b17 100644 --- a/cpu/esp8266/Makefile.include +++ b/cpu/esp8266/Makefile.include @@ -158,3 +158,7 @@ else FFLAGS += 0 $(FLASHFILE)-0x00000.bin FFLAGS += 0x10000 $(FLASHFILE)-0x10000.bin; esptool.py -p $(PORT) run endif + +OPTIONAL_CFLAGS_BLACKLIST += -fdiagnostics-color +OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow +OPTIONAL_CFLAGS_BLACKLIST += -Wformat-truncation diff --git a/makefiles/arch/atmega.inc.mk b/makefiles/arch/atmega.inc.mk index 0d932d9b1f6d..5789a00a1bfd 100644 --- a/makefiles/arch/atmega.inc.mk +++ b/makefiles/arch/atmega.inc.mk @@ -50,3 +50,6 @@ ifeq ($(LTO),1) # See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59396 LINKFLAGS += -Wno-error endif + +OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow +OPTIONAL_CFLAGS_BLACKLIST += -Wformat-truncation diff --git a/makefiles/arch/mips.inc.mk b/makefiles/arch/mips.inc.mk index 5ff6935539e7..27053bff0c25 100644 --- a/makefiles/arch/mips.inc.mk +++ b/makefiles/arch/mips.inc.mk @@ -66,3 +66,6 @@ export LINKFLAGS += $(MIPS_HAL_LDFLAGS) export LINKFLAGS += -L$(RIOTCPU)/$(CPU)/ldscripts export LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) export LINKFLAGS += -Wl,--gc-sections + +OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow +OPTIONAL_CFLAGS_BLACKLIST += -Wformat-truncation diff --git a/makefiles/arch/msp430.inc.mk b/makefiles/arch/msp430.inc.mk index 59be092b9899..31b75020f9de 100644 --- a/makefiles/arch/msp430.inc.mk +++ b/makefiles/arch/msp430.inc.mk @@ -14,3 +14,7 @@ CFLAGS += $(CFLAGS_CPU) $(CFLAGS_LINK) $(CFLAGS_DBG) $(CFLAGS_OPT) ASFLAGS += $(CFLAGS_CPU) --defsym $(CPU_MODEL)=1 $(CFLAGS_DBG) # export linker flags export LINKFLAGS += $(CFLAGS_CPU) $(CFLAGS_DBG) $(CFLAGS_OPT) -Wl,--gc-sections -static -lgcc + +OPTIONAL_CFLAGS_BLACKLIST += -fdiagnostics-color +OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow +OPTIONAL_CFLAGS_BLACKLIST += -Wformat-truncation diff --git a/makefiles/cflags.inc.mk b/makefiles/cflags.inc.mk index 48f52c9cd0a8..96627d22f461 100644 --- a/makefiles/cflags.inc.mk +++ b/makefiles/cflags.inc.mk @@ -11,37 +11,19 @@ endif # 0x0 might be a sane memory location for embedded systems, so the test must not be removed. # Right now clang does not use the *delete-null-pointer* optimization, and does not understand the parameter. # Related issues: #628, #664. -ifeq ($(shell $(CC) -fno-delete-null-pointer-checks -E - 2>/dev/null >/dev/null &1 1>/dev/null /dev/null >/dev/null &1 1>/dev/null /dev/null >/dev/null