Fixing gcc8's no-unknown-warning-option issue.

Before gcc8, it was ignoring any unknown -Wno-* command, leaving clang's
-Wno-unknown-warning-option to mix. That's no longer the case.
pull/20004/head
Nicolas Noble 5 years ago
parent 83e6044739
commit 5877f2e56b
  1. 8
      Makefile
  2. 2
      build.yaml
  3. 6
      grpc.gyp
  4. 2
      templates/Makefile.template

@ -330,6 +330,12 @@ ifeq ($(HAS_WORKING_NO_MAYBE_UNINITIALIZED),true)
W_NO_MAYBE_UNINITIALIZED=-Wno-maybe-uninitialized
NO_W_NO_MAYBE_UNINITIALIZED=-Wmaybe-uninitialized
endif
CHECK_NO_UNKNOWN_WARNING_OPTION_WORKS_CMD = $(CC) -std=c99 -Werror -Wno-unknown-warning-option -o $(TMPOUT) -c test/build/no-unknown-warning-option.c
HAS_WORKING_NO_UNKNOWN_WARNING_OPTION = $(shell $(CHECK_NO_UNKNOWN_WARNING_OPTION_WORKS_CMD) 2> /dev/null && echo true || echo false)
ifeq ($(HAS_WORKING_NO_UNKNOWN_WARNING_OPTION),true)
W_NO_UNKNOWN_WARNING_OPTION=-Wno-unknown-warning-option
NO_W_NO_UNKNOWN_WARNING_OPTION=-Wunknown-warning-option
endif
# The HOST compiler settings are used to compile the protoc plugins.
# In most cases, you won't have to change anything, but if you are
@ -348,7 +354,7 @@ CXXFLAGS += -stdlib=libc++
LDFLAGS += -framework CoreFoundation
endif
CXXFLAGS += -Wnon-virtual-dtor
CPPFLAGS += -g -Wall -Wextra -Werror -Wno-unknown-warning-option -Wno-long-long -Wno-unused-parameter -Wno-deprecated-declarations -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers -Wno-maybe-uninitialized -DPB_FIELD_32BIT -DOSATOMIC_USE_INLINED=1 -Ithird_party/nanopb -Ithird_party/upb -Isrc/core/ext/upb-generated
CPPFLAGS += -g -Wall -Wextra -Werror $(W_NO_UNKNOWN_WARNING_OPTION) -Wno-long-long -Wno-unused-parameter -Wno-deprecated-declarations -Wno-sign-conversion -Wno-shadow -Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers -Wno-maybe-uninitialized -DPB_FIELD_32BIT -DOSATOMIC_USE_INLINED=1 -Ithird_party/nanopb -Ithird_party/upb -Isrc/core/ext/upb-generated
COREFLAGS += -fno-rtti -fno-exceptions
LDFLAGS += -g

@ -6199,7 +6199,7 @@ defaults:
CXXFLAGS: $(W_NO_CXX14_COMPAT)
global:
COREFLAGS: -fno-rtti -fno-exceptions
CPPFLAGS: -g -Wall -Wextra -Werror -Wno-unknown-warning-option -Wno-long-long
CPPFLAGS: -g -Wall -Wextra -Werror $(W_NO_UNKNOWN_WARNING_OPTION) -Wno-long-long
-Wno-unused-parameter -Wno-deprecated-declarations -Wno-sign-conversion -Wno-shadow
-Wno-conversion -Wno-implicit-fallthrough -Wno-sign-compare -Wno-missing-field-initializers
-Wno-maybe-uninitialized -DPB_FIELD_32BIT -DOSATOMIC_USE_INLINED=1 -Ithird_party/nanopb

@ -55,7 +55,7 @@
'-Wall',
'-Wextra',
'-Werror',
'-Wno-unknown-warning-option',
'$(W_NO_UNKNOWN_WARNING_OPTION)',
'-Wno-long-long',
'-Wno-unused-parameter',
'-Wno-deprecated-declarations',
@ -146,7 +146,7 @@
'-Wall',
'-Wextra',
'-Werror',
'-Wno-unknown-warning-option',
'$(W_NO_UNKNOWN_WARNING_OPTION)',
'-Wno-long-long',
'-Wno-unused-parameter',
'-Wno-deprecated-declarations',
@ -168,7 +168,7 @@
'-Wall',
'-Wextra',
'-Werror',
'-Wno-unknown-warning-option',
'$(W_NO_UNKNOWN_WARNING_OPTION)',
'-Wno-long-long',
'-Wno-unused-parameter',
'-Wno-deprecated-declarations',

@ -37,7 +37,7 @@
# warnings we'd like, but that dont exist in all compilers
PREFERRED_WARNINGS=['extra-semi']
CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-unused-but-set-variable', 'no-maybe-uninitialized']
CHECK_WARNINGS=PREFERRED_WARNINGS + ['no-shift-negative-value', 'no-unused-but-set-variable', 'no-maybe-uninitialized', 'no-unknown-warning-option']
def warning_var(fmt, warning):
return fmt % warning.replace('-', '_').replace('+', 'X').upper()

Loading…
Cancel
Save