Closed Bug 1363555 Opened 7 years ago Closed 7 years ago

equality comparison with extraneous parentheses warning from IS_TEAROFF_CLASS macro

Categories

(Core :: XPConnect, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla55
Tracking Status
firefox55 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

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 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+
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/2dc612bec44b
Make IS_TEAROFF_CLASS into a function. r=mrbkap
https://hg.mozilla.org/mozilla-central/rev/2dc612bec44b
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: