Closed Bug 834762 Opened 7 years ago Closed 7 years ago

yarr/MatchResult.h:58:44: warning: overflow in implicit constant conversion [-Woverflow]

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla21
Tracking Status
firefox20 --- fixed

People

(Reporter: dholbert, Assigned: sstangl)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

After bug 830676's patch landed, I now get:
{
mozilla/js/src/yarr/MatchResult.h:58:44: warning: overflow in implicit constant conversion [-Woverflow]
}
on my linux 64-bit machine.
The line of code pointed to is:
> 58         return MatchResult(WTF::notFound, 0);

and bug 830676 changed that MatchResult constructor to take 'int' instead of 'size_t'.

It looks like it changed another usage of notFound to explicitly be converted to an int:
> 63         return start != int(WTF::notFound);

Presumably we want to do add an "int" cast at line 58, too.  Or alternately, as luke suggested in bug 830676 comment 13, we could perhaps change notFound to be already an int.
(Note: Because this is a build warning in a .h file, we spam multiple instances of this -- one for each .cpp file that ends up #including this file, directly or indirectly.)
Attached patch fixSplinter Review
This is the fix. Tree is closed, but I've been pinged constantly because that assertion is really annoying, so feel free to push this once the tree opens.

If not, I'll push it tomorrow.
http://hg.mozilla.org/integration/mozilla-inbound/rev/42eb5399753e (with commit-message changes to be slightly more informative :-) )
Assignee: general → sstangl
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla21
https://hg.mozilla.org/mozilla-central/rev/42eb5399753e
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Pushed to Aurora:
http://hg.mozilla.org/releases/mozilla-aurora/rev/9c559854783b

Where are the approval flags?
(In reply to Scoobidiver from comment #6)
> Pushed to Aurora:
> http://hg.mozilla.org/releases/mozilla-aurora/rev/9c559854783b
> 
> Where are the approval flags?

In Bug 830676.
You need to log in before you can comment on or make changes to this bug.