summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Engert <kaie@kuix.de>2016-09-23 20:31:37 +0200
committerKai Engert <kaie@kuix.de>2016-09-23 20:31:37 +0200
commite04fc36178bb8b21d8383189dc78f0b93721aaeb (patch)
tree60f67a26d73b2211de29d3164f4d1cb3749dd007
parentc27f2a47b61be1c260e138ec3bea2522cb63770d (diff)
downloadnss-hg-e04fc36178bb8b21d8383189dc78f0b93721aaeb.tar.gz
Bug 1293334, bustage fix, the compiler flag to suppress errors about misleading whitespace, is only required with gcc 6 and newer, and only on the old branch that doesn't contain our whitespace cleanup. r=franziskus
-rw-r--r--coreconf/Werror.mk8
1 files changed, 7 insertions, 1 deletions
diff --git a/coreconf/Werror.mk b/coreconf/Werror.mk
index bc3f575e3..80bf0790d 100644
--- a/coreconf/Werror.mk
+++ b/coreconf/Werror.mk
@@ -60,7 +60,13 @@ ifndef WARNING_CFLAGS
endif #ndef NSS_ENABLE_WERROR
ifeq ($(NSS_ENABLE_WERROR),1)
- WARNING_CFLAGS += -Werror -Wno-error=misleading-indentation
+ WARNING_CFLAGS += -Werror
+ # For gcc 6 and newer we need -Wno-error=misleading-indentation
+ # to prevent compiler errors caused by mixed whitespace.
+ CC_VERSION := $(subst ., ,$(shell $(CC) -dumpversion))
+ ifeq (,$(filter 0 1 2 3 4 5,$(word 1,$(CC_VERSION))))
+ WARNING_CFLAGS += -Wno-error=misleading-indentation
+ endif
else
# Old versions of gcc (< 4.8) don't support #pragma diagnostic in functions.
# Use this to disable use of that #pragma and the warnings it suppresses.