Closed Bug 815450 Opened 13 years ago Closed 13 years ago

TestAudioEventTimeline.cpp:42:3: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]

Categories

(Core :: Audio/Video, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Build warning: { /content/media/webaudio/compiledtest/TestAudioEventTimeline.cpp: In instantiation of ‘void is(const T&, const U&, const char*) [with T = unsigned int; U = int]’: /content/media/webaudio/compiledtest/TestAudioEventTimeline.cpp:198:50: required from here Warning: -Wsign-compare in /content/media/webaudio/compiledtest/TestAudioEventTimeline.cpp: comparison between signed and unsigned integer expressions /content/media/webaudio/compiledtest/TestAudioEventTimeline.cpp:42:3: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] } This is for this line: > 198 is(timeline.GetEventCount(), 0, "No events yet"); http://mxr.mozilla.org/mozilla-central/source/content/media/webaudio/compiledtest/TestAudioEventTimeline.cpp#198 "0" is being treated as a signed int there, whereas GetEventCount() is unsigned. We should just make it "0u" and then all will be well.
Attached patch fix v1Splinter Review
This happens a bunch of times in this file, but GCC only warns for the first one. (So if I fix the one instance quoted in comment 0, then GCC warns about the next one, etc.) This fixes all of them, making the directory warning-free (since this is the only CPP file there), and labels it as such.
Attachment #685405 - Flags: review?(ehsan)
Attachment #685405 - Flags: review?(ehsan) → review+
Try run (just debug builds, no tests) to be sure the FAIL_ON_WARNINGS doesn't bust stuff on the other platforms where it's honored: https://tbpl.mozilla.org/?tree=Try&rev=2ba635ffbf3f
Flags: in-testsuite-
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: