activate more warnings and ease their mgmt

This commit is contained in:
Philippe Teuwen 2020-05-03 19:25:14 +02:00
commit 4d4984657e
5 changed files with 19 additions and 13 deletions

View file

@ -44,3 +44,18 @@ else
AR= ar rcs
RANLIB= ranlib
endif
DEFCFLAGS = -Wall -Werror -O3
# Some more warnings we want as errors:
DEFCFLAGS += -Wredundant-decls -Wmissing-prototypes -Wchar-subscripts -Wundef -Wwrite-strings -Wunused -Wuninitialized -Wpointer-arith -Winline -Wformat -Wformat-security -Winit-self -Wmissing-include-dirs -Wnested-externs -Wmissing-declarations
# Some more warnings we need first to eliminate, so temporarely tolerated:
DEFCFLAGS += -Wbad-function-cast -Wno-error=bad-function-cast -Wshadow -Wno-error=shadow -Wcast-align -Wno-error=cast-align
# TODO?:
#DEFCFLAGS += -Wextra -Wswitch-enum -Wold-style-definition
ifeq ($(platform),Darwin)
# their readline has strict-prototype issues
DEFCFLAGS += -Wstrict-prototypes -Wno-error=strict-prototypes
else
DEFCFLAGS += -Wstrict-prototypes
endif