Closed Bug 933124 Opened 6 years ago Closed 6 years ago

Fix -Wformat warning in nsObjCExceptions.h: values of type 'NSUInteger' should not be used as format arguments

Categories

(Core :: XPCOM, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla28
Tracking Status
firefox25 --- unaffected
firefox26 --- affected
firefox27 --- wontfix
firefox28 --- fixed

People

(Reporter: cpeterson, Assigned: cpeterson)

References

(Blocks 1 open bug)

Details

(Whiteboard: [qa-])

Attachments

(1 file)

When trying to build a 32-bit debug on OS X, I hit the following warning-as-error:

In file included from mozilla/central/uriloader/exthandler/mac/nsLocalHandlerAppMac.mm:8:                                                        
../../dist/include/nsObjCExceptions.h:90:62: error: values of type 'NSUInteger' should not be used as format arguments; add an explicit cast to 'unsigned long' instead [-Werror,-Wformat]
[args addObject:[NSString stringWithFormat:@"0x%lx", address]];
                                               ~~~   ^~~~~~~
                                                     (unsigned long)

Cocoa typedefs NSUInteger as unsigned long:

> When building 32-bit applications, NSUInteger is a 32-bit unsigned integer. A 64-bit application treats NSUInteger as a 64-bit unsigned integer
Attachment #825117 - Flags: review?(doug.turner)
Comment on attachment 825117 [details] [diff] [review]
fix-NSUInteger-warning.patch

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

lgtm
Attachment #825117 - Flags: review?(doug.turner) → review+
Assignee: nobody → cpeterson
Status: NEW → ASSIGNED
https://hg.mozilla.org/mozilla-central/rev/a769047ad5ad
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.