Closed
Bug 924608
Opened 11 years ago
Closed 11 years ago
tautological compare warning in MemoryMetrics.h
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
mozilla27
People
(Reporter: mccr8, Assigned: terrence)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.41 KB,
patch
|
n.nethercote
:
review+
|
Details | Diff | Splinter Review |
I get this in Clang for every file that includes that header: 5:27.13 Warning: -Wtautological-compare in /home/amccreight/cent/obj-dbg/dist/include/js/MemoryMetrics.h: self-comparison always evaluates to true 5:27.13 ../../../dist/include/js/MemoryMetrics.h:388:1140: warning: self-comparison always evaluates to true [-Wtautological-compare] 5:27.13 n += (js::IsLiveGCThing == js::IsLiveGCThing) ? objectsGCHeapOrdinary : 0; n += (js::IsLiveGCThing == js::IsLiveGCThing) ? objectsGCHeapFunction : 0; [and it goes on and on]
Reporter | ||
Updated•11 years ago
|
Blocks: buildwarning
Reporter | ||
Comment 1•11 years ago
|
||
Terrence suggested this fix. Basically, you just make the enum boolean valued. Clang seems okay with boolean-constant tautologies.
Assignee | ||
Comment 2•11 years ago
|
||
Comment on attachment 814551 [details] [diff] [review] use boolean-valued enums to avoid the tauto warning Review of attachment 814551 [details] [diff] [review]: ----------------------------------------------------------------- https://tbpl.mozilla.org/?tree=Try&rev=7b30d8e1af26 ::: js/public/MemoryMetrics.h @@ +60,5 @@ > #define DECL_SIZE(gc, mSize) size_t mSize; > #define ZERO_SIZE(gc, mSize) mSize(0), > #define COPY_OTHER_SIZE(gc, mSize) mSize(other.mSize), > #define ADD_OTHER_SIZE(gc, mSize) mSize += other.mSize; > +#define ADD_SIZE_TO_N_IF_LIVE_GC_THING(gc, mSize) n += gc ? mSize : 0; Keep parens around the (gc) because MACROS.
Attachment #814551 -
Flags: review?(n.nethercote)
Updated•11 years ago
|
Attachment #814551 -
Flags: review?(n.nethercote) → review+
Reporter | ||
Comment 4•11 years ago
|
||
Terrence, is this ready to land? I can do a Windows try push if that's what's holding this back.
Flags: needinfo?(terrence)
Assignee | ||
Comment 5•11 years ago
|
||
The try push I did above came back with windows orange and red, including some rebuilds later in the day. The errors look spurious, but when I checked the base's push on m-i the windows builds were green. Maybe it was temporary tbpl bustage? A second try run would not be amiss.
Flags: needinfo?(terrence)
Reporter | ||
Comment 6•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=0ea88194b4f9
Reporter | ||
Comment 7•11 years ago
|
||
Windows try run is totally green.
Assignee | ||
Comment 8•11 years ago
|
||
Must have been my tip then. Pushed. https://hg.mozilla.org/integration/mozilla-inbound/rev/c3d14caa839a
Assignee | ||
Updated•11 years ago
|
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/c3d14caa839a
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in
before you can comment on or make changes to this bug.
Description
•