Closed
Bug 791138
Opened 12 years ago
Closed 12 years ago
SPSProfiler.cpp:410:73: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.09 KB,
patch
|
Details | Diff | Splinter Review |
Reporting build warning: { ../../../mozilla/js/src/vm/SPSProfiler.cpp: In member function ‘jsbytecode* js::ProfileEntry::pc() volatile’: ../../../mozilla/js/src/vm/SPSProfiler.cpp:410:73: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] } The line of code is: > 410 JS_ASSERT_IF(idx != NullPCIndex, idx >= 0 && idx < script()->length); https://mxr.mozilla.org/mozilla-central/source/js/src/vm/SPSProfiler.cpp#410 I don't immediately see where idx is declared, but it appears to be signed (since we bother comparing it >= 0), and JSScript::length is unsigned (uint32_t) https://mxr.mozilla.org/mozilla-central/source/js/src/jsscript.h#369 ...so that last comparison is the source of this warning: "idx < script()->length" We can just cast idx to uint32_t there, since we've already checked that it's non-negative.
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #661060 -
Flags: review?(nicolas.b.pierron)
Comment 2•12 years ago
|
||
I fixed this in bug 791608.
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Updated•12 years ago
|
Attachment #661060 -
Flags: review?(nicolas.b.pierron)
You need to log in
before you can comment on or make changes to this bug.
Description
•