Closed
Bug 458728
Opened 16 years ago
Closed 13 years ago
gcc warning: src/nsAttrAndChildArray.cpp:169: warning: comparison is always true due to limited range of data type
Categories
(Developer Infrastructure :: Source Code Analysis, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: guninski, Unassigned)
References
(Blocks 1 open bug)
Details
(Whiteboard: [build_warning])
Attachments
(1 file)
1.14 KB,
patch
|
bzbarsky
:
review-
|
Details | Diff | Splinter Review |
+++ This bug was initially created as a clone of Bug #458491 +++
Updated•13 years ago
|
Whiteboard: [build_warning]
Updated•13 years ago
|
Comment 1•13 years ago
|
||
http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsAttrAndChildArray.cpp#169
167 PRUint32 childCount = ChildCount();
168
169 NS_ENSURE_TRUE(childCount < ATTRCHILD_ARRAY_MAX_CHILD_COUNT,
170 NS_ERROR_FAILURE);
Summary: gcc warning: src/nsAttrAndChildArray.cpp:167: warning: comparison is always true due to limited range of data type → gcc warning: src/nsAttrAndChildArray.cpp:169: warning: comparison is always true due to limited range of data type
Comment 2•13 years ago
|
||
For future reference...
ChildCount() is defined here:
http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsAttrAndChildArray.h#83
ATTRCHILD_ARRAY_MAX_CHILD_COUNT here:
http://mxr.mozilla.org/mozilla-central/source/content/base/src/nsAttrAndChildArray.h#66
Updated•13 years ago
|
Blocks: buildwarning
Is this a valid problem?
Maybe today the comparison is unneeded with the current value of ATTRCHILD_ARRAY_MAX_CHILD_COUNT. But if that constant changes, it may be necessary to catch it here.
Comment 4•13 years ago
|
||
Attachment #620444 -
Flags: review?(bmo)
Comment 5•13 years ago
|
||
Comment on attachment 620444 [details] [diff] [review]
Patch
Sorry, I'm not a peer; redirecting to someone who is :-)
Attachment #620444 -
Flags: review?(bmo) → review?(bzbarsky)
Comment 6•13 years ago
|
||
Why is this warning at all? childCount is a PRUint32. ATTRCHILD_ARRAY_MAX_CHILD_COUNT should be 0x3fffff. There are certainly values of PRUint32 that are bigger than that!
Marco, I assume you reproduced the warning?
Comment 7•13 years ago
|
||
Note that back when the bug was filed, a 64-bit build would have warned here. But that should have been fixed in bug 480655.
Comment 8•13 years ago
|
||
(In reply to Boris Zbarsky (:bz) from comment #6)
> Marco, I assume you reproduced the warning?
No, I just assumed it was reproducible. I didn't see the bug was so old.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → INVALID
Updated•13 years ago
|
Attachment #620444 -
Flags: review?(bzbarsky) → review-
Updated•7 years ago
|
Product: Core → Firefox Build System
Updated•2 years ago
|
Product: Firefox Build System → Developer Infrastructure
You need to log in
before you can comment on or make changes to this bug.
Description
•