From df3fd1d12823e3241df52b9ad48d5e1f5de21262 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Wed, 12 Aug 2015 14:54:16 -0700 Subject: [PATCH] Never allow -w. Apparently -w will disable all warnings on GCC regardless of ordering (clang will still respect ordering so warnings that are enabled after -w are still respected). This is insane. Strip -w from the cflags. Anyone that wants this flag should be turning off the specific warnings (or just fix them), not disabling all warnings. Change-Id: I2ba065637dfdc192921da4d9adbdc63b728c166f --- core/binary.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/core/binary.mk b/core/binary.mk index c716b179d..c22b8484b 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -1125,6 +1125,15 @@ ifeq ($(my_fdo_build), true) my_cflags := $(filter-out $(fdo_incompatible_flags),$(my_cflags)) endif +# No one should ever use this flag. On GCC it's mere presence will disable all +# warnings, even those that are specified after it (contrary to typical warning +# flag behavior). This circumvents CFLAGS_NO_OVERRIDE from forcibly enabling the +# warnings that are *always* bugs. +my_illegal_flags := -w +my_cflags := $(filter-out $(my_illegal_flags),$(my_cflags)) +my_cppflags := $(filter-out $(my_illegal_flags),$(my_cppflags)) +my_conlyflags := $(filter-out $(my_illegal_flags),$(my_conlyflags)) + $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_YACCFLAGS := $(LOCAL_YACCFLAGS) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_ASFLAGS := $(my_asflags) $(LOCAL_INTERMEDIATE_TARGETS): PRIVATE_CONLYFLAGS := $(my_conlyflags) -- 2.11.0