aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJustin Chadwell <justin.chadwell@arm.com>2019-07-31 11:36:41 +0100
committerMadhukar Pappireddy <madhukar.pappireddy@arm.com>2019-11-19 08:52:59 -0600
commit9ab81b5ea9811b673668c43289bb48c85c4f9659 (patch)
tree1d000fa7d58de1e454d98126ebbe58ebbd11b0c2
parentaf1ac83e0fa4e77aad13e1e8e47b6fcafeb17dbc (diff)
downloadplatform_external_arm-trusted-firmware-9ab81b5ea9811b673668c43289bb48c85c4f9659.tar.gz
platform_external_arm-trusted-firmware-9ab81b5ea9811b673668c43289bb48c85c4f9659.tar.bz2
platform_external_arm-trusted-firmware-9ab81b5ea9811b673668c43289bb48c85c4f9659.zip
Refactor the warning flags
This patch keeps the same warnings, and simply reorders them to keep all the warning options together in one place. Change-Id: Ibb655dcabc84f3af01a0d7f71f5af7e0479c2521 Signed-off-by: Justin Chadwell <justin.chadwell@arm.com>
-rw-r--r--Makefile24
1 files changed, 14 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 721246d51..534896a79 100644
--- a/Makefile
+++ b/Makefile
@@ -228,6 +228,13 @@ endif
ASFLAGS_aarch32 = $(march32-directive)
ASFLAGS_aarch64 = $(march64-directive)
+# General warnings
+WARNINGS := -Wall -Wmissing-include-dirs -Wunused \
+ -Wdisabled-optimization -Wvla \
+ -Wno-unused-parameter
+
+# Additional warnings
+# Level 1
WARNING1 := -Wextra
WARNING1 += -Wmissing-declarations
WARNING1 += -Wmissing-format-attribute
@@ -253,17 +260,14 @@ WARNING3 += -Wredundant-decls
WARNING3 += -Wswitch-default
ifeq (${W},1)
-WARNINGS := $(WARNING1)
+WARNINGS += $(WARNING1)
else ifeq (${W},2)
-WARNINGS := $(WARNING1) $(WARNING2)
+WARNINGS += $(WARNING1) $(WARNING2)
else ifeq (${W},3)
-WARNINGS := $(WARNING1) $(WARNING2) $(WARNING3)
+WARNINGS += $(WARNING1) $(WARNING2) $(WARNING3)
endif
-WARNINGS += -Wunused -Wno-unused-parameter \
- -Wdisabled-optimization \
- -Wvla
-
+# Compiler specific warnings
ifeq ($(findstring clang,$(notdir $(CC))),)
# not using clang
WARNINGS += -Wunused-but-set-variable \
@@ -279,12 +283,12 @@ ifneq (${E},0)
ERRORS := -Werror
endif
-CPPFLAGS = ${DEFINES} ${INCLUDES} ${MBEDTLS_INC} -nostdinc \
- -Wmissing-include-dirs $(ERRORS) $(WARNINGS)
+CPPFLAGS = ${DEFINES} ${INCLUDES} ${MBEDTLS_INC} -nostdinc \
+ $(ERRORS) $(WARNINGS)
ASFLAGS += $(CPPFLAGS) $(ASFLAGS_$(ARCH)) \
-ffreestanding -Wa,--fatal-warnings
TF_CFLAGS += $(CPPFLAGS) $(TF_CFLAGS_$(ARCH)) \
- -ffreestanding -fno-builtin -Wall -std=gnu99 \
+ -ffreestanding -fno-builtin -std=gnu99 \
-Os -ffunction-sections -fdata-sections
ifeq (${SANITIZE_UB},on)