config: make -Werror optional and off by default
Allow end users to build the code even if, for example, warnings are added with new compilers versions. -Werror is still enforced for automated builds. Change-Id: I567009d55cf5b941c452bd41d09f75d03b037209 Signed-off-by: Daniel Verkamp <daniel.verkamp@intel.com>
This commit is contained in:
parent
eae688576a
commit
55d9ff6a66
3
CONFIG
3
CONFIG
@ -34,6 +34,9 @@
|
||||
# Build with debug logging. Turn off for performance testing and normal usage
|
||||
CONFIG_DEBUG?=n
|
||||
|
||||
# Treat warnings as errors (fail the build on any warning).
|
||||
CONFIG_WERROR?=n
|
||||
|
||||
# Build with code coverage instrumentation.
|
||||
CONFIG_COVERAGE?=n
|
||||
|
||||
|
@ -43,7 +43,11 @@ endif
|
||||
|
||||
OS := $(shell uname)
|
||||
|
||||
COMMON_CFLAGS = -g $(C_OPT) -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -Wstrict-prototypes -Werror -fno-strict-aliasing -march=native -m64 -I$(SPDK_ROOT_DIR)/include
|
||||
COMMON_CFLAGS = -g $(C_OPT) -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wmissing-declarations -Wstrict-prototypes -fno-strict-aliasing -march=native -m64 -I$(SPDK_ROOT_DIR)/include
|
||||
|
||||
ifeq ($(CONFIG_WERROR), y)
|
||||
COMMON_CFLAGS += -Werror
|
||||
endif
|
||||
|
||||
COMMON_CFLAGS += -Wformat -Wformat-security -Wformat-nonliteral
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
set -xe
|
||||
ulimit -c unlimited
|
||||
|
||||
MAKECONFIG='CONFIG_DEBUG=y'
|
||||
MAKECONFIG='CONFIG_DEBUG=y CONFIG_WERROR=y'
|
||||
|
||||
case `uname` in
|
||||
FreeBSD)
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
set -xe
|
||||
|
||||
make -C test/lib/nvme/unit
|
||||
make -C test/lib/nvme/unit CONFIG_WERROR=y
|
||||
|
||||
test/lib/nvme/unit/nvme_c/nvme_ut
|
||||
test/lib/nvme/unit/nvme_ctrlr_c/nvme_ctrlr_ut
|
||||
@ -10,6 +10,6 @@ test/lib/nvme/unit/nvme_ctrlr_cmd_c/nvme_ctrlr_cmd_ut
|
||||
test/lib/nvme/unit/nvme_ns_cmd_c/nvme_ns_cmd_ut
|
||||
test/lib/nvme/unit/nvme_qpair_c/nvme_qpair_ut
|
||||
|
||||
make -C test/lib/ioat/unit
|
||||
make -C test/lib/ioat/unit CONFIG_WERROR=y
|
||||
|
||||
test/lib/ioat/unit/ioat_ut
|
||||
|
Loading…
Reference in New Issue
Block a user