Makefile.common: add a couple of C warning flags.

Most notably, -Wdeclaration-after-statement.  This and -Wpointer-arith
give some warning on linux, but this is "harmless" as it's assumed that
we'll be always compiling with GCC or Clang there.

Also, erratum in the "Make ksqrt take uint32_t ..." commit:
 hypotenuse -> squared length of the hypotenuse

git-svn-id: https://svn.eduke32.com/eduke32@2797 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-07-01 22:11:35 +00:00
parent bdedbc6f76
commit 57dbedf59d

View file

@ -171,10 +171,18 @@ else
W_NO_UNUSED_RESULT :=
endif
BASECFLAGS=$(debug) -W -Wall -Werror-implicit-function-declaration \
CWARNS := -W -Wall -Wdeclaration-after-statement -Werror-implicit-function-declaration \
-Wpointer-arith \
-Wextra \
#-Wstrict-prototypes \
#-Waggregate-return \
#-Wwrite-strings \
#-Wcast-qual -Wcast-align \
#-Waddress -Wlogical-op
BASECFLAGS=$(debug) $(CWARNS) \
-funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 \
$(F_JUMP_TABLES) $(W_NO_UNUSED_RESULT) $(ARCH) \
-Wextra #-Wwrite-strings -Waddress -Wlogical-op
$(F_JUMP_TABLES) $(W_NO_UNUSED_RESULT) $(ARCH)
ifneq (0,$(CLANG))
BASECFLAGS+= -Wno-unused-value -Wno-parentheses
endif