Last Comment Bug 840834 - Build failure - Clang + warnings as errors: MediaManager.cpp: equality comparison with extraneous parentheses
: Build failure - Clang + warnings as errors: MediaManager.cpp: equality compar...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: DOM (show other bugs)
: Trunk
: All All
: -- normal (vote)
: mozilla22
Assigned To: Alex Xu
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-02-12 18:24 PST by Alex Xu
Modified: 2013-02-25 18:39 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch (659 bytes, patch)
2013-02-23 10:40 PST, Alex Xu
rjesup: review+
Details | Diff | Review

Description Alex Xu 2013-02-12 18:24:32 PST
Build Firefox with ccache and Clang; generated clang invocation:

/usr/bin/ccache clang++ -o MediaManager.o -c -I../../dist/stl_wrappers -I../../dist/system_wrappers -include /home/alex/mozilla/config/gcc_hidden.h -D_IMPL_NS_LAYOUT -DMOZ_GLUE_IN_PROGRAM -DMOZILLA_INTERNAL_API -D_IMPL_NS_COM -DEXPORT_XPT_API -DEXPORT_XPTC_API -D_IMPL_NS_GFX -D_IMPL_NS_WIDGET -DIMPL_XREAPI -DIMPL_NS_NET -DIMPL_THEBES -DSTATIC_EXPORTABLE_JS_API -DNO_NSPR_10_SUPPORT -DEXCLUDE_SKIA_DEPENDENCIES -DOS_POSIX=1 -DOS_LINUX=1 -I<snip long list> -I. -I../../dist/include -I/usr/include/nspr -I/home/alex/mozilla/obj-x86_64-unknown-linux-gnu/dist/include/nss -fPIC -Qunused-arguments -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wno-invalid-offsetof -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-type-c-linkage -Wno-mismatched-tags -Wformat -Wformat-security -Werror=format-security -march=native -O2 -pipe -march=native -fno-exceptions -fno-strict-aliasing -fno-rtti -ffunction-sections -fdata-sections -fno-exceptions -std=gnu++0x -pthread -pipe -DNDEBUG -DTRIMMED -g -O2 -fomit-frame-pointer -Werror -Wno-error=uninitialized -Wno-error=deprecated-declarations -Qunused-arguments -DMOZILLA_CLIENT -include ../../mozilla-config.h -MD -MF .deps/MediaManager.o.pp /home/alex/mozilla/dom/media/MediaManager.cpp

Results:

16:07.84 /home/alex/mozilla/dom/media/MediaManager.cpp:916:23: error: equality comparison with extraneous parentheses [-Werror,-Wparentheses-equality]
16:07.84       if ((permission == nsIPopupWindowManager::DENY_POPUP)) {
16:07.84            ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16:07.84 /home/alex/mozilla/dom/media/MediaManager.cpp:916:23: note: remove extraneous parentheses around the comparison to silence this warning
16:07.84       if ((permission == nsIPopupWindowManager::DENY_POPUP)) {
16:07.84           ~           ^                                   ~
16:07.84 /home/alex/mozilla/dom/media/MediaManager.cpp:916:23: note: use '=' to turn this equality comparison into an assignment
16:07.84       if ((permission == nsIPopupWindowManager::DENY_POPUP)) {
16:07.84                       ^~
16:07.84                       =
16:07.84 1 error generated.
...
16:07.85 gmake[6]: *** [MediaManager.o] Error 1
16:07.85 gmake[5]: *** [media_libs] Error 2

This *does* seem to be a legitimate error; however, it is odd that it only showed up today when the code was added back in Aug 2012. (https://hg.mozilla.org/mozilla-central/annotate/fdf15fa098d9/dom/media/MediaManager.cpp#l916, https://hg.mozilla.org/mozilla-central/rev/88755b34790a)
Comment 1 Alex Xu 2013-02-23 10:40:48 PST
Created attachment 717528 [details] [diff] [review]
Patch
Comment 2 Ryan VanderMeulen [:RyanVM] 2013-02-25 06:44:54 PST
https://hg.mozilla.org/integration/mozilla-inbound/rev/57b34be82096
Comment 3 Ryan VanderMeulen [:RyanVM] 2013-02-25 18:39:41 PST
https://hg.mozilla.org/mozilla-central/rev/57b34be82096

Note You need to log in before you can comment on or make changes to this bug.