Closed
Bug 861386
Opened 11 years ago
Closed 6 years ago
fix build warning in docshell
Categories
(Core :: DOM: Navigation, defect)
Tracking
()
RESOLVED
INVALID
People
(Reporter: gia, Assigned: gia)
Details
Attachments
(1 file)
1.39 KB,
text/plain
|
Details |
/home/gia/mozilla-central/docshell/base/nsDocShell.cpp:801:44: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat]
/home/gia/mozilla-central/docshell/base/nsDocShell.cpp: In destructor ‘virtual nsDocShell::~nsDocShell()’:
/home/gia/mozilla-central/docshell/base/nsDocShell.cpp:830:46: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘uint64_t {aka long unsigned int}’ [-Wformat]
Assignee | ||
Comment 1•11 years ago
|
||
I will submit the patch soon.
Assignee | ||
Comment 2•11 years ago
|
||
Attachment #736974 -
Flags: review?(justin.lebar+bug)
Comment 3•11 years ago
|
||
It's unfortunately more complicated than this.
On Linux 64 and Mac 64, uint64_t == unsigned long int. But on Windows 64, uint64_t == unsigned long long int. So this change just moves the warning from one platform to another.
What you actually want is the PRIu64 macro from inttypes.h [1], which you'd use as
uint64_t foo;
printf("foo = " PRIu64 "\n", foo);
but I'm not sure if we have this on all platforms. I suspect we may not have it on Windows because inttypes.h includes stdint.h, which we had to re-implement ourselves for Windows in mfbt/StandardInteger.h.
If you wanted to add the printf type specifiers from inttypes.h into MSStdInt.h (or an auxiliary header), that would be interesting. But that may be more complex a patch than you intended to write. :)
I suppose we could get rid of the warnings by static_cast'ing everything to <long long unsigned> and then using %llu. That's kind of ugly, but maybe it's better than the warning.
[1] http://pubs.opengroup.org/onlinepubs/009604599/basedefs/inttypes.h.html
Updated•11 years ago
|
Attachment #736974 -
Flags: review?(justin.lebar+bug)
Comment 4•11 years ago
|
||
Assignee | ||
Comment 5•11 years ago
|
||
This sounds tricky, but I will try to add the printf type specifiers
Assignee | ||
Comment 6•11 years ago
|
||
could you assign this bug to me?
Comment 7•11 years ago
|
||
Even better, you should now have permission to set it yourself. :)
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → georgiana.chelu93
Comment 8•6 years ago
|
||
Fixed in bug 944694 Patch 1.
Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
You need to log in
before you can comment on or make changes to this bug.
Description
•