[warnings] add -Wshadow which helps detect local variables that override globals

Nothing particularly bad showed up but cleaned up a bit of code.
This commit is contained in:
Travis Geiselbrecht
2020-07-25 16:46:34 -07:00
parent 82b4d6ffdb
commit f7d8e2300c
29 changed files with 117 additions and 126 deletions

View File

@@ -56,7 +56,8 @@ CONFIGHEADER := $(BUILDDIR)/config.h
GLOBAL_INCLUDES := $(BUILDDIR) $(addsuffix /include,$(LKINC))
GLOBAL_OPTFLAGS ?= $(ARCH_OPTFLAGS)
GLOBAL_COMPILEFLAGS := -g -include $(CONFIGHEADER)
GLOBAL_COMPILEFLAGS += -W -Wall -Wno-multichar -Wno-unused-parameter -Wno-unused-function -Wno-unused-label -Werror=return-type -Wno-nonnull-compare
GLOBAL_COMPILEFLAGS += -W -Wall -Werror=return-type -Wshadow
GLOBAL_COMPILEFLAGS += -Wno-multichar -Wno-unused-parameter -Wno-unused-function -Wno-unused-label -Wno-nonnull-compare
GLOBAL_COMPILEFLAGS += -fno-common
GLOBAL_CFLAGS := --std=gnu11 -Werror-implicit-function-declaration -Wstrict-prototypes -Wwrite-strings
GLOBAL_CPPFLAGS := --std=c++11 -fno-exceptions -fno-rtti -fno-threadsafe-statics