Closed Bug 836149 Opened 7 years ago Closed 7 years ago

Windows build warning: " e:/builds/moz2_slave/try-w32/build/tools/profiler/TableTicker.cpp(868) : warning C4018: '<' : signed/unsigned mismatch"

Categories

(Core :: Gecko Profiler, defect)

All
Windows 7
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Build warning:
{
e:/builds/moz2_slave/try-w32/build/tools/profiler/TableTicker.cpp(868) : warning C4018: '<' : signed/unsigned mismatch
}
https://tbpl.mozilla.org/php/getParsedLog.php?id=19250178&tree=Try

It looks like the signed variable in question starts at 0 and it only increases from there, so we should be fine making it unsigned.
Attached patch fixSplinter Review
The line in question is:
>      while (pseudoStackPos < stack->stackSize()) {

stackSize() returns uint32_t, as shown here:
  https://mxr.mozilla.org/mozilla-central/source/tools/profiler/sps_sampler.h#368

So, we can fix this by just making pseudoStackPos the same type, uint32_t.

The patch I'm posting has absurd amounts of contextual code included, to show that pseudoStackPos's can never be negative. (as noted above, it starts at 0 and is only incremented from that point.)
Attachment #707935 - Flags: review?(bgirard)
Attachment #707935 - Flags: review?(bgirard) → review+
https://hg.mozilla.org/mozilla-central/rev/8ef47aa7120f
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in before you can comment on or make changes to this bug.