Bug 1389851 - sandbox: Suppress -Wunreachable-code-return warning in third-party Chromium sandbox code. r?jld draft
authorChris Peterson <cpeterson@mozilla.com>
Wed, 09 Aug 2017 18:45:16 -0700
changeset 647394 bb01ae0692d6c9ce5b89b1826d472c4d70497ce1
parent 645468 30e6b0fd69ff4b3599eb6744ba12ccb75ea28598
child 647395 41a95f938fc5c05e0e8564bed0f615a483dc3a38
push id74381
push usercpeterson@mozilla.com
push dateWed, 16 Aug 2017 08:08:22 +0000
reviewersjld
bugs1389851
milestone57.0a1
Bug 1389851 - sandbox: Suppress -Wunreachable-code-return warning in third-party Chromium sandbox code. r?jld security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc:277:12: warning: 'return' will never be executed [-Wunreachable-code-return] This return statement is unreachable because SANDBOX_DIE() is a noreturn function: https://searchfox.org/mozilla-central/rev/a887f0edbd9f6b176b64111455ba62bb0cf356a6/security/sandbox/chromium/sandbox/linux/seccomp-bpf/trap.cc#270-274 MozReview-Commit-ID: HDxBJe2ZtPN
security/sandbox/linux/moz.build
--- a/security/sandbox/linux/moz.build
+++ b/security/sandbox/linux/moz.build
@@ -77,19 +77,20 @@ if CONFIG['MOZ_GMP_SANDBOX']:
         'SandboxOpenedFiles.cpp',
     ]
 
 # This copy of SafeSPrintf doesn't need to avoid the Chromium logging
 # dependency like the one in libxul does, but this way the behavior is
 # consistent.  See also the comment in SandboxLogging.h.
 SOURCES['../chromium/base/strings/safe_sprintf.cc'].flags += ['-DNDEBUG']
 
-# Keep clang from warning about intentional 'switch' fallthrough in icu_utf.cc:
 if CONFIG['CLANG_CXX']:
+    # Keep clang from warning about intentional 'switch' fallthrough in icu_utf.cc:
     SOURCES['../chromium/base/third_party/icu/icu_utf.cc'].flags += ['-Wno-implicit-fallthrough']
+    SOURCES['../chromium/sandbox/linux/seccomp-bpf/trap.cc'].flags += ['-Wno-unreachable-code-return']
 
 if CONFIG['GNU_CXX']:
     CXXFLAGS += ['-Wno-shadow']
     SOURCES['../chromium/sandbox/linux/services/syscall_wrappers.cc'].flags += [
         '-Wno-empty-body',
     ]
 
 # gcc lto likes to put the top level asm in syscall.cc in a different partition