The default bug view has changed. See this FAQ.

Build failure - Clang + warnings as errors: MediaManager.cpp: equality comparison with extraneous parentheses

RESOLVED FIXED in mozilla22

Status

()

Core
DOM
RESOLVED FIXED
4 years ago
4 years ago

People

(Reporter: Alex Xu, Assigned: Alex Xu)

Tracking

Trunk
mozilla22
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

4 years ago
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)
(Assignee)

Updated

4 years ago
Hardware: x86_64 → All
Summary: MediaManager.cpp: equality comparison with extraneous parentheses → Build failure - Clang + warnings as errors: MediaManager.cpp: equality comparison with extraneous parentheses
(Assignee)

Comment 1

4 years ago
Created attachment 717528 [details] [diff] [review]
Patch
Attachment #717528 - Flags: review?(rjesup)
(Assignee)

Updated

4 years ago
OS: Linux → All

Updated

4 years ago
Attachment #717528 - Flags: review?(rjesup) → review+
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
https://hg.mozilla.org/integration/mozilla-inbound/rev/57b34be82096
Assignee: nobody → alex_y_xu
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/57b34be82096
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla22
You need to log in before you can comment on or make changes to this bug.