Closed
Bug 900209
Opened 11 years ago
Closed 11 years ago
Element.cpp:1969:59 [-Wformat=] format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'nsEventStates::InternalType {aka long unsigned int}'
Categories
(Core :: DOM: Core & HTML, defect)
Tracking
()
RESOLVED
FIXED
mozilla25
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug)
Details
Attachments
(1 file)
1.23 KB,
patch
|
smaug
:
review+
|
Details | Diff | Splinter Review |
My debug build spams this warning: { content/base/src/Element.cpp:1969:59 [-Wformat=] format '%llx' expects argument of type 'long long unsigned int', but argument 3 has type 'nsEventStates::InternalType {aka long unsigned int}' } which, as it turns out, is the only remaining warning that I see for all of /content/base. The code in question is: > 1969 fprintf(out, " state=[%llx]", State().GetInternalValue()); http://mxr.mozilla.org/mozilla-central/source/content/base/src/Element.cpp#1969 where GetInternalValue() returns InternalType, which is typedefed to uint64_t (which, on 64-bit linux, is a typedef for to "unsigned long", not unsigned-long-long, as the warning indicates. This is pretty easy to fix -- we can just static_cast to unsigned long long, to *force* the arg to match the format string. The minor downside is that on 64-bit architectures, this will do some unnecessary promotion, but that should be harmless, since the promotion is safe and this is in a chunk of debugging code anyway (where perf isn't a factor).
Assignee | ||
Comment 1•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
Blocks: buildwarning
Assignee | ||
Comment 2•11 years ago
|
||
(Note: bug 730805 has a better way of doing this, but it seems to have stagnated.)
Updated•11 years ago
|
Attachment #784002 -
Flags: review?(bugs) → review+
Assignee | ||
Updated•11 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 3•11 years ago
|
||
https://tbpl.mozilla.org/?tree=Try&rev=bda2669dc092
Comment 4•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/8e78d28f3b46
Keywords: checkin-needed
Assignee | ||
Updated•11 years ago
|
Flags: in-testsuite-
Comment 5•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/8e78d28f3b46
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Assignee | ||
Updated•11 years ago
|
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•