mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-18 10:46:25 +00:00
Increase default warning level
This patch enables the warnings -Wextra, -Weffc++, and -Werror for compiling Genode components. It thereby helps us to detect bugs like uninitialized member variables or missing virtual destructors at compile time. The warning level is defined via the new 'CC_CXX_WARN_STRICT' variable. For targets that compile 3rd-party code where this warning level is not applicable, the variable may be explictly set to an empty value in the corresponding build-description file. Issue #465
This commit is contained in:
parent
eba9c15746
commit
c30299feca
@ -107,6 +107,12 @@ endif
|
||||
CC_OLEVEL ?= -O2
|
||||
CC_WARN ?= -Wall
|
||||
|
||||
#
|
||||
# Additional warnings for C++
|
||||
#
|
||||
CC_CXX_WARN_STRICT ?= -Wextra -Weffc++ -Werror
|
||||
CC_CXX_WARN ?= $(CC_WARN) $(CC_CXX_WARN_STRICT)
|
||||
|
||||
#
|
||||
# Aggregate compiler options that are common for C and C++
|
||||
#
|
||||
@ -133,7 +139,7 @@ CC_OPT += $(CC_OPT_PIC)
|
||||
#
|
||||
# Predefine C and C++ specific compiler options with their common values
|
||||
#
|
||||
CC_CXX_OPT += $(CC_OPT)
|
||||
CC_CXX_OPT += $(CC_OPT) $(CC_CXX_WARN)
|
||||
CC_C_OPT += $(CC_OPT)
|
||||
CC_ADA_OPT += $(CC_OPT)
|
||||
|
||||
@ -153,7 +159,7 @@ CC_RUSTC_OPT += $(foreach lib,$(LIBS),-L$(LIB_CACHE_DIR)/$(lib))
|
||||
#
|
||||
CC_CXX_OPT_STD ?= -std=gnu++11
|
||||
CC_CXX_OPT += $(lastword $(CC_CXX_OPT_STD) $(CC_CXX_OPT_STD_$(subst .,_,$*)))
|
||||
|
||||
|
||||
#
|
||||
# Linker options
|
||||
#
|
||||
|
Loading…
Reference in New Issue
Block a user