equality comparison with extraneous parentheses warning from IS_TEAROFF_CLASS macro

RESOLVED FIXED in Firefox 55

Status

()

RESOLVED FIXED
a year ago
a year ago

People

(Reporter: mccr8, Assigned: mccr8)

Tracking

(Blocks: 1 bug)

unspecified
mozilla55
Points:
---

Firefox Tracking Flags

(firefox55 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Assignee)

Description

a year ago
0:15.20 In file included from /home/amccreight/mc/obj-dbg.noindex/js/xpconnect/src/Unified_cpp_js_xpconnect_src0.cpp:20:
 0:15.20 /home/amccreight/mc/js/xpconnect/src/XPCCallContext.cpp:67:25: warning: equality comparison with extraneous parentheses [-Wparentheses-equality]
 0:15.20     } else if (((clasp) == &XPC_WN_Tearoff_JSClass)) {
 0:15.20                 ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~
 0:15.20 /home/amccreight/mc/js/xpconnect/src/XPCCallContext.cpp:67:25: note: remove extraneous parentheses around the comparison to silence this warning
 0:15.20     } else if (((clasp) == &XPC_WN_Tearoff_JSClass)) {
 0:15.20                ~        ^                         ~
 0:15.20 /home/amccreight/mc/js/xpconnect/src/XPCCallContext.cpp:67:25: note: use '=' to turn this equality comparison into an assignment
 0:15.20     } else if (((clasp) == &XPC_WN_Tearoff_JSClass)) {
 0:15.20                         ^~
 0:15.20                         =

The basic problem is that IS_TEAROFF_CLASS is a macro, and I guess this warning sees through this macro. The easiest way is to do what was done for IS_WN_CLASS and make it a function. I'll rename it while I'm at it, as there is only a single use.
Comment hidden (mozreview-request)
Comment on attachment 8866878 [details]
Bug 1363555 - Make IS_TEAROFF_CLASS into a function.

https://reviewboard.mozilla.org/r/138468/#review142810
Attachment #8866878 - Flags: review?(mrbkap) → review+

Comment 3

a year ago
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2dc612bec44b
Make IS_TEAROFF_CLASS into a function. r=mrbkap

Comment 4

a year ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/2dc612bec44b
Status: NEW → RESOLVED
Last Resolved: a year ago
status-firefox55: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.