Closed
Bug 865774
Opened 11 years ago
Closed 11 years ago
cpr_string.c:203:78: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
Categories
(Core :: WebRTC, defect)
Tracking
()
RESOLVED
FIXED
mozilla23
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug)
Details
(Whiteboard: [WebRTC][blocking-webrtc-][qa-])
Attachments
(1 file)
1.25 KB,
patch
|
jesup
:
review+
|
Details | Diff | Splinter Review |
GCC warning: { media/webrtc/signaling/src/sipcc/cpr/common/cpr_string.c:203:78: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] } for this line: 203 MOZ_ASSERT(vsnprintf_result > 0 && vsnprintf_result < (fs->buffer_length - fs->string_length)); http://mxr.mozilla.org/mozilla-central/source/media/webrtc/signaling/src/sipcc/cpr/common/cpr_string.c#203 * vsnprintf_result is signed (it's an int) * fs->buffer_length - fs->string_length is unsigned (both are 'size_t') We can just static_cast vsnprintf_result to size_t, which is safe because we just checked that it's greater than 0.
Assignee | ||
Comment 1•11 years ago
|
||
er, s/static_cast/cast/ since this is a .c file
Assignee | ||
Comment 2•11 years ago
|
||
Assignee | ||
Comment 3•11 years ago
|
||
MXR link showing that buffer_length and string_length are size_t: > 73 typedef struct { > 74 char *buffer; > 75 size_t buffer_length; > 76 size_t string_length; > 77 } flex_string; http://mxr.mozilla.org/mozilla-central/source/media/webrtc/signaling/src/sipcc/cpr/include/cpr_string.h#75
Updated•11 years ago
|
Attachment #741940 -
Flags: review?(rjesup) → review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Updated•11 years ago
|
Whiteboard: [WebRTC][blocking-webrtc-]
Comment 4•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/d3f88b2e42f7
Flags: in-testsuite-
Keywords: checkin-needed
Comment 5•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/d3f88b2e42f7
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla23
Updated•11 years ago
|
Whiteboard: [WebRTC][blocking-webrtc-] → [WebRTC][blocking-webrtc-][qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•