Closed Bug 824879 Opened 7 years ago Closed 7 years ago

Avoid -Wconstant-conversion warnings in vm/RegExpObject.cpp.

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: njn, Assigned: njn)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Clang 3.2 warns:

js/src/vm/RegExpObject.cpp:125:27 [-Wconstant-conversion] implicit conversion
from 'size_t' (aka 'unsigned long') to 'int' changes value from 1844674
4073709551615 to -1
js/src/vm/RegExpObject.cpp:126:27 [-Wconstant-conversion] implicit conversion
from 'size_t' (aka 'unsigned long') to 'int' changes value from 1844674
4073709551615 to -1
MatchPair.{start,limit} are both |int|, so the current code converts -1 from
|int| to |size_t| and back to |int|.  This patch just gets rid of the |size_t|
cast.
Attachment #695904 - Flags: review?(sstangl)
Blocks: buildwarning
Comment on attachment 695904 [details] [diff] [review]
Avoid -Wconstant-conversion warnings in vm/RegExpObject.cpp.

Review of attachment 695904 [details] [diff] [review]:
-----------------------------------------------------------------

This was supposed to be fixed in Bug 820124, but it's not sticking. It's fine to fix it separately.
Attachment #695904 - Flags: review?(sstangl) → review+
https://hg.mozilla.org/mozilla-central/rev/cee4cc007aa6
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.