mirror of
https://github.com/linux-msm/cdba.git
synced 2026-02-25 13:11:56 -08:00
Makefile: enable several warnings and -Werror
After fixing all the warnings (at least on gcc v11.3.0), enable them as errors, so any silent builds will explicitly fail (also in Continuous Integration builds). Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
This commit is contained in:
committed by
Bjorn Andersson
parent
a785bd1ab1
commit
acb6508e4f
20
Makefile
20
Makefile
@@ -6,6 +6,26 @@ SERVER := cdba-server
|
||||
all: $(CLIENT) $(SERVER)
|
||||
|
||||
CFLAGS := -Wall -g -O2
|
||||
# Wextra without few warnings
|
||||
CFLAGS := $(CFLAGS) -Wextra -Wno-unused-parameter -Wno-unused-result -Wno-missing-field-initializers -Wno-sign-compare
|
||||
|
||||
# Few clang version still have warnings so fail only on GCC
|
||||
GCC_CFLAGS := -Werror
|
||||
GCC_CFLAGS += -Wformat-signedness -Wnull-dereference -Wduplicated-cond -Wduplicated-branches -Wvla-larger-than=1
|
||||
GCC_CFLAGS += -Walloc-zero -Wstringop-truncation -Wdouble-promotion -Wshadow -Wunsafe-loop-optimizations
|
||||
GCC_CFLAGS += -Wpointer-arith -Wcast-align -Wwrite-strings -Wlogical-op -Wstrict-overflow=4 -Wundef -Wjump-misses-init
|
||||
CLANG_CFLAGS := -Wnull-dereference -Wdouble-promotion -Wshadow -Wpointer-arith -Wwrite-strings -Wstrict-overflow=4 -Wundef
|
||||
# TODO:
|
||||
# GCC_CFLAGS += -Wcast-qual
|
||||
# CLANG_CFLAGS += -Wcast-qual -Wcast-align
|
||||
ifeq ($(CC),cc)
|
||||
CFLAGS += $(GCC_CFLAGS)
|
||||
else ifeq ($(CC),clang)
|
||||
CFLAGS += $(CLANG_CFLAGS)
|
||||
else
|
||||
$(info No compiler flags for: $(CC))
|
||||
endif
|
||||
|
||||
LDFLAGS := -ludev -lyaml -lftdi -lusb
|
||||
|
||||
CLIENT_SRCS := cdba.c circ_buf.c
|
||||
|
||||
Reference in New Issue
Block a user