security/sandbox/linux/SandboxFilter.cpp: statement will never be executed [-Werror=switch-unreachable]

RESOLVED FIXED in Firefox 56

Status

()

defect
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: sylvestre, Assigned: sylvestre)

Tracking

Trunk
mozilla56
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox56 fixed)

Details

Attachments

(1 attachment)

+++ This bug was initially created as a clone of Bug #1371626 +++

Fails the build with gcc 7.1 & --enable-warnings-as-errors

/usr/bin/g++-7 -std=gnu++11 -o SandboxChroot.o -c  -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/system_wrappers -include /root/firefox-gcc-last/config/gcc_hidden.h -DDEBUG=1 -DNS_NO_XPCOM -I/root/firefox-gcc-last/security/sandbox/linux -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/security/sandbox/linux -I/root/firefox-gcc-last/security/sandbox/linux -I/root/firefox-gcc-last/security/sandbox/chromium-shim -I/root/firefox-gcc-last/security/sandbox/chromium -I/root/firefox-gcc-last/nsprpub -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include  -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/nspr -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/nss       -fPIC  -DMOZILLA_CLIENT -include /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/mozilla-config.h -MD -MP -MF .deps/SandboxChroot.o.pp  -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wc++1z-compat -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wformat -Wformat-overflow=2 -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe  -g -freorder-blocks -Os -fno-omit-frame-pointer  -Werror -Wno-shadow  /root/firefox-gcc-last/security/sandbox/linux/SandboxChroot.cpp
/usr/bin/g++-7 -std=gnu++11 -o SandboxFilter.o -c  -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/system_wrappers -include /root/firefox-gcc-last/config/gcc_hidden.h -DDEBUG=1 -DNS_NO_XPCOM -I/root/firefox-gcc-last/security/sandbox/linux -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/security/sandbox/linux -I/root/firefox-gcc-last/security/sandbox/linux -I/root/firefox-gcc-last/security/sandbox/chromium-shim -I/root/firefox-gcc-last/security/sandbox/chromium -I/root/firefox-gcc-last/nsprpub -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include  -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/nspr -I/root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/dist/include/nss       -fPIC  -DMOZILLA_CLIENT -include /root/firefox-gcc-last/obj-x86_64-pc-linux-gnu/mozilla-config.h -MD -MP -MF .deps/SandboxFilter.o.pp  -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wc++1z-compat -Wno-error=maybe-uninitialized -Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-error=free-nonheap-object -Wformat -Wformat-overflow=2 -fno-exceptions -fno-strict-aliasing -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe  -g -freorder-blocks -Os -fno-omit-frame-pointer  -Werror -Wno-shadow  /root/firefox-gcc-last/security/sandbox/linux/SandboxFilter.cpp
/root/firefox-gcc-last/security/sandbox/linux/SandboxFilter.cpp: In member function 'virtual mozilla::Maybe<std::shared_ptr<const sandbox::bpf_dsl::internal::ResultExprImpl> > mozilla::ContentSandboxPolicy::EvaluateIpcCall(int) const':
/root/firefox-gcc-last/security/sandbox/linux/SandboxFilter.cpp:578:24: error: statement will never be executed [-Werror=switch-unreachable]
       return Some(Allow());
Comment on attachment 8888729 [details]
Bug 1383007 - Move the declaration in the #ifdef declaration to silent a warning

https://reviewboard.mozilla.org/r/159756/#review165194

r=me for the sandbox change; thanks for the fix.

::: build/moz.configure/toolchain.configure:1186
(Diff revision 1)
> +@depends('--enable-linker', select_linker, c_compiler)
> +def select_linker(value, gold, c_compiler):
> +    if linker == 'lld':
> +        if c_compiler.type != 'clang':
> +            die("lld requires clang (version >= 3.8)")
> +    return "-fuse-ld=" + linker

Did you mean to include this change?  This would need a build peer.
Attachment #8888729 - Flags: review?(jld) → review+
Comment on attachment 8888729 [details]
Bug 1383007 - Move the declaration in the #ifdef declaration to silent a warning

https://reviewboard.mozilla.org/r/159756/#review165194

> Did you mean to include this change?  This would need a build peer.

oups, my bad. fixed
Pushed by sledru@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/394b3d22db19
Move the declaration in the #ifdef declaration to silent a warning r=jld
https://hg.mozilla.org/mozilla-central/rev/394b3d22db19
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
You need to log in before you can comment on or make changes to this bug.