Closed
Bug 900209
Opened 12 years ago
Closed 12 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•12 years ago
|
||
Assignee | ||
Updated•12 years ago
|
Blocks: buildwarning
Assignee | ||
Comment 2•12 years ago
|
||
(Note: bug 730805 has a better way of doing this, but it seems to have stagnated.)
Updated•12 years ago
|
Attachment #784002 -
Flags: review?(bugs) → review+
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Assignee | ||
Comment 3•12 years ago
|
||
Comment 4•12 years ago
|
||
Keywords: checkin-needed
Assignee | ||
Updated•12 years ago
|
Flags: in-testsuite-
Comment 5•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla25
Assignee | ||
Updated•12 years ago
|
Updated•6 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•