Closed Bug 911425 Opened 11 years ago Closed 11 years ago

[-Wsign-compare] comparison of integers of different signs: 'off_t' (aka 'long long') and 'unsigned long long'

Categories

(Core :: XPCOM, defect)

24 Branch
x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla26
Tracking Status
firefox25 --- wontfix
firefox26 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Fix clang warning on OS X introduced by bug 845907:

xpcom/glue/FileUtils.cpp:459:13 [-Wsign-compare] comparison of integers of different signs: 'off_t' (aka 'long long') and 'unsigned long long'
Attachment #798136 - Flags: review?(mh+mozilla)
Comment on attachment 798136 [details] [diff] [review]
fix-FileUtils-Wsign-compare.patch

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

::: xpcom/glue/FileUtils.cpp
@@ +449,5 @@
>    // loader is going to map the file in memory. We use that
>    // information to find the biggest offset from the library that
>    // will be mapped in memory.
>    char *cmd = &base[sizeof(struct cpu_mach_header)];
> +  size_t end = 0;

might as well make it a uint32_t, since that's what it's defined to in mach-o headers. Don't worry about overflows, all that'd achieve is doing less readahead.
Attachment #798136 - Flags: review?(mh+mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/3a23243301c9
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: