Closed
Bug 539585
Opened 15 years ago
Closed 14 years ago
warning: format ‘%p’ expects type ‘void*’, but argument [n] has type ‘[class]*’
Categories
(Core :: General, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: dholbert)
Details
(Whiteboard: [build_warning])
Attachments
(6 files, 1 obsolete file)
9.77 KB,
text/plain
|
Details | |
3.41 KB,
patch
|
benjamin
:
review+
|
Details | Diff | Splinter Review |
1.86 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
2.63 KB,
patch
|
dbaron
:
review+
|
Details | Diff | Splinter Review |
17.53 KB,
patch
|
dholbert
:
review+
|
Details | Diff | Splinter Review |
4.99 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
Filing this bug on fixing gcc / g++ build warnings like this one: { mozilla/content/svg/content/src/nsSVGStringProxyValue.cpp:154: warning: format ‘%p’ expects type ‘void*’, but argument 2 has type ‘nsSVGStringProxyValue*’ } see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26542 for discussion on this warning. It's easy to fix -- just static_cast the pointer to be a void*, when passing to printf. Currently we've got 67 warnings of this type. 3 of those are in sqlite3.c, and the rest are in mozilla code. (most in /editor/libeditor/base/*Txn.cpp)
Assignee | ||
Comment 1•15 years ago
|
||
Attachment #421535 -
Flags: review?(benjamin)
Assignee | ||
Comment 2•15 years ago
|
||
Attachment #421536 -
Flags: review?
Assignee | ||
Updated•15 years ago
|
Attachment #421536 -
Flags: review? → review?(jst)
Assignee | ||
Comment 3•15 years ago
|
||
Attachment #421540 -
Flags: review?(neil)
Assignee | ||
Comment 4•15 years ago
|
||
Attachment #421541 -
Flags: review?(dbaron)
Assignee | ||
Comment 5•15 years ago
|
||
With the 4 attached patches, we're just left with the 3 of these warnings in sqlite3.c.
Comment 6•15 years ago
|
||
Comment on attachment 421540 [details] [diff] [review] fix for /editor/ directory >+ printf("%p Undo Insert Element of %p into parent %p at offset %d\n", >+ static_cast<void*>(this), >+ static_cast<void*>(mNode.get()), >+ static_cast<void*>(mParent.get()), mOffset); Nit: when you need more than two lines to list all the printf parameters, I think it might make more sense to put them all on separate lines, to reduce the chance that one subsequently gets overlooked.
Attachment #421540 -
Flags: review?(neil) → review+
Comment on attachment 421541 [details] [diff] [review] fix for /layout/ directory r=dbaron I hate this warning.
Attachment #421541 -
Flags: review?(dbaron) → review+
Assignee | ||
Comment 8•15 years ago
|
||
(In reply to comment #6) > Nit: when you need more than two lines to list all the printf parameters, I > think it might make more sense to put them all on separate lines, to reduce > the chance that one subsequently gets overlooked. Agreed - fixed in this version. Carrying forward r+. (In reply to comment #7) > I hate this warning. Yeah, me too.
Attachment #421540 -
Attachment is obsolete: true
Attachment #421551 -
Flags: review+
Updated•15 years ago
|
Attachment #421536 -
Flags: review?(jst) → review+
Assignee | ||
Comment 9•15 years ago
|
||
Landed patches for /content, /editor, and /layout: http://hg.mozilla.org/mozilla-central/rev/f01750182bfc http://hg.mozilla.org/mozilla-central/rev/019b7d6e4fc0 http://hg.mozilla.org/mozilla-central/rev/8e0c12450eee
Assignee | ||
Comment 10•14 years ago
|
||
Pushed a fix for a new instance of this in nsTableFrame.cpp: http://hg.mozilla.org/mozilla-central/rev/8816f2b76e41
Assignee | ||
Comment 11•14 years ago
|
||
Here's a patch to fix a few instances of this warning in testing/mochitest/ssltunnel/ssltunnel.cpp (introduced with some logging code in changeset b7ee0f1acfef). This also removes a few tab characters from that file.
Attachment #424889 -
Flags: review?
Assignee | ||
Updated•14 years ago
|
Attachment #424889 -
Flags: review? → review?(jwalden+bmo)
Comment 12•14 years ago
|
||
Comment on attachment 424889 [details] [diff] [review] fix for /testing/ directory I echo dbaron.
Attachment #424889 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 13•14 years ago
|
||
Landed fix for /testing/: http://hg.mozilla.org/mozilla-central/rev/4ac114ee6247
Assignee | ||
Updated•14 years ago
|
Status: NEW → ASSIGNED
Updated•14 years ago
|
Attachment #421535 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 14•14 years ago
|
||
Landed fix for /xpcom/: http://hg.mozilla.org/mozilla-central/rev/970ed5de45ad That's all the patches posted here. Resolving as FIXED.
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee | ||
Updated•14 years ago
|
Whiteboard: [build_warning]
You need to log in
before you can comment on or make changes to this bug.
Description
•