Closed
Bug 1258175
Opened 8 years ago
Closed 8 years ago
Remove -Wunreachable-code-return and -Wunreachable-code-aggressive flags
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(firefox48 fixed)
RESOLVED
FIXED
mozilla48
Tracking | Status | |
---|---|---|
firefox48 | --- | fixed |
People
(Reporter: cpeterson, Assigned: cpeterson)
References
Details
Attachments
(1 file)
5.56 KB,
patch
|
glandium
:
review+
|
Details | Diff | Splinter Review |
compiler-opts.m4's check for `MOZ_CXX_SUPPORTS_WARNING(-W, unreachable-code-return, ac_cxx_has_wunreachable_code_return)` is broken. The C/C++ code that configure emits for MOZ_CXX_SUPPORTS_WARNING() actually contains a -Wunreachable-code-return warning and, thus, doesn't actually detect that clang supports the -Wunreachable-code-return flag. This configure code in MOZ_CXX_SUPPORTS_WARNING(): AC_TRY_COMPILE([], [return(0);], $3="yes", $3="no") generates something like: int main() { return(0); ; return 0; } where the second return, automatically emitted by configure, is unreachable and causes a -Wunreachable-code-return warning. The fix is to remove the redundant return(0) from MOZ_CXX_SUPPORTS_WARNING(). This allows clang's -Wunreachable-code-return flag to be detected, but then -Wunreachable-code-return breaks other configure checks, including third-party libraries' configure checks (in particular jemalloc) that also have redundant `return(0)`. So all the third-party libraries' configure checks would need to be fixed upstream, which seems like more hassle than the value of the -Wunreachable-code-return warnings. So I propose we just remove the flag. :) This patch also: * removes the -Wunreachable-code-aggressive check because the flag enables -Wunreachable-code-return. * replaces the MOZ_CXX_SUPPORTS_WARNING() check for -Wunreachable-code because both clang and gcc support -Wunreachable-code (though it is a no-op with gcc) so we can just unconditionally add -Wunreachable-code warning to _WARNINGS_CXXFLAGS.
Attachment #8732587 -
Flags: review?(mh+mozilla)
Assignee | ||
Updated•8 years ago
|
Blocks: Wunreachable-code
status-firefox48:
--- → affected
Comment 1•8 years ago
|
||
Comment on attachment 8732587 [details] [diff] [review] remove-Wunreachable-code-return.patch Review of attachment 8732587 [details] [diff] [review]: ----------------------------------------------------------------- A part (if not the whole) of comment 0 should go into the commit message.
Attachment #8732587 -
Flags: review?(mh+mozilla) → review+
Comment 4•8 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/eb458f5d7b32
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Assignee | ||
Updated•7 years ago
|
Depends on: Wunreachable-code-return
Updated•6 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•