mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-31 17:31:18 +01:00
makefiles/cflags.inc.mk: Add -Wno-missing-field-initializers to CXXFLAGS
This allows including C headers from C++. It sadly reduced the diagnostics on C++ code as well, were there warning may make sense as unintended side effect. We may be able to drop that later on, when more C APIs are properly wrapped in native C++ APIs, so that C headers do no longer need to be compatible with C++ compilers.
This commit is contained in:
parent
19d3ccc78f
commit
16df27c51d
@ -87,6 +87,13 @@ ifeq (,$(filter -DDEVELHELP,$(CFLAGS)))
|
||||
CFLAGS += -DNDEBUG
|
||||
endif
|
||||
endif
|
||||
|
||||
# Add the optional flags that are not architecture/toolchain blacklisted
|
||||
CFLAGS += $(filter-out $(OPTIONAL_CFLAGS_BLACKLIST),$(OPTIONAL_CFLAGS))
|
||||
|
||||
# Improve C++ compatibility with our C headers: In C it is both valid and good
|
||||
# practise to implicitly initialize struct members with zero by omitting them
|
||||
# in a initializer list. The C++ compiler greatly frowns upon this, even within
|
||||
# `extern "C" { ... }`. The best would be to configure the C++ compiler to
|
||||
# accept good C practises within `extern "C" { ... }` while enforcing good C++
|
||||
# practises elsewhere. But in absence of this, we disable the warning for now.
|
||||
CXXEXFLAGS += -Wno-missing-field-initializers
|
||||
|
||||
@ -14,7 +14,6 @@ CFLAGS += $(INCLUDES)
|
||||
CFLAGS += -DATCA_HAL_I2C
|
||||
CFLAGS += -Wno-cast-align
|
||||
CFLAGS += -Wno-char-subscripts
|
||||
CFLAGS += -Wno-missing-field-initializers
|
||||
CFLAGS += -Wno-overflow
|
||||
CFLAGS += -Wno-pointer-to-int-cast
|
||||
CFLAGS += -Wno-sign-compare
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
MODULE = semtech_loramac_mac_region
|
||||
|
||||
CFLAGS += -Wno-missing-field-initializers -Wno-unused-parameter -Wno-sign-compare
|
||||
CFLAGS += -Wno-sign-compare
|
||||
CFLAGS += -Wno-unused-parameter
|
||||
|
||||
INCLUDES += -I$(PKGDIRBASE)/semtech-loramac/src/boards \
|
||||
-I$(PKGDIRBASE)/semtech-loramac/src/radio
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
MODULE = tensorflow-lite-kernels
|
||||
|
||||
CXXEXFLAGS += -Wno-missing-field-initializers
|
||||
CXXEXFLAGS += -Wno-unused-function
|
||||
CXXEXFLAGS += -Wno-unused-parameter
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
MODULE = tensorflow-lite-kernels-internal
|
||||
|
||||
CXXEXFLAGS += -Wno-missing-field-initializers
|
||||
CXXEXFLAGS += -Wno-unused-function
|
||||
CXXEXFLAGS += -Wno-unused-parameter
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
MODULE = tensorflow-lite-micro-kernels
|
||||
|
||||
CXXEXFLAGS += -Wno-missing-field-initializers
|
||||
CXXEXFLAGS += -Wno-strict-overflow
|
||||
CXXEXFLAGS += -Wno-type-limits
|
||||
CXXEXFLAGS += -Wno-unused-parameter
|
||||
|
||||
@ -12,7 +12,6 @@ CFLAGS += -Wno-strict-prototypes
|
||||
CFLAGS += -Wno-maybe-uninitialized
|
||||
CFLAGS += -Wno-missing-braces
|
||||
CFLAGS += -Wno-missing-declarations
|
||||
CFLAGS += -Wno-missing-field-initializers
|
||||
CFLAGS += -Wno-old-style-definition
|
||||
CFLAGS += -Wno-return-type
|
||||
CFLAGS += -Wno-sign-compare
|
||||
|
||||
@ -10,7 +10,4 @@ SRC := core.c util.c periodic.c
|
||||
# enable submodules
|
||||
SUBMODULES := 1
|
||||
|
||||
# disable obsolete warning
|
||||
CFLAGS += -Wno-missing-field-initializers
|
||||
|
||||
include $(RIOTBASE)/Makefile.base
|
||||
|
||||
@ -25,7 +25,4 @@ ifneq (,$(filter ncv7356,$(TRX_TO_BUILD)))
|
||||
CFLAGS += -DNCV7356_MODE1_PIN=$(NCV7356_MODE1_PIN)
|
||||
endif
|
||||
|
||||
# Some boards throw a missing-field-initializers error
|
||||
CFLAGS += -Wno-missing-field-initializers
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
||||
@ -37,9 +37,6 @@ endif
|
||||
CFLAGS += -DCAN_PKT_BUF_SIZE=64
|
||||
CFLAGS += -DCAN_ROUTER_MAX_FILTER=32
|
||||
|
||||
# Some boards throw a missing-field-initializers error
|
||||
CFLAGS += -Wno-missing-field-initializers
|
||||
|
||||
include $(RIOTBASE)/Makefile.include
|
||||
|
||||
ifndef CONFIG_GNRC_PKTBUF_SIZE
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user