[cfe-users] -Wunreachable-code warnings can no longer be suppressed?

Chris Peterson via cfe-users cfe-users at lists.llvm.org
Fri Aug 5 15:56:11 PDT 2016


I suppressed a -Wunreachable-code warning in Firefox earlier this year 
[1] by adding extra parentheses, as suggested by Xcode's clang on OS X:

objdir-osx/dom/bindings/TestJSImplGenBinding.cpp:47639:20: note: silence 
by adding parentheses to mark code as explicitly dead
        if (false && !CallerSubsumes(temp)) {
                     ^
                     /* DISABLES CODE */ ()

This is generated C++ code in Firefox, so changing the code generator to 
emit the extra parentheses was easier than complicating the code 
generator's logic for this particular case.

Unfortunately, this Firefox warning is back [2] because clang 3.9 on 
Linux no longer recognizes the parentheses suppression. Is this an 
intentional change to -Wunreachable-code or a regression? I don't see 
the warning string "silence by adding parentheses to mark code as 
explicitly dead" in the clang code on GitHub [3], but I see a few clang 
tests that appear to expect that warning string.

thanks,
chris

[1] https://bugzilla.mozilla.org/show_bug.cgi?id=1223265
[2] https://bugzilla.mozilla.org/show_bug.cgi?id=1291397
[3] https://github.com/llvm-mirror/clang


More information about the cfe-users mailing list