Closed
Bug 529350
Opened 16 years ago
Closed 16 years ago
Fix build warnings: "'void PumpEvents()' defined but not used", "'void QuitPumpingEvents()' defined but not used"
Categories
(Core :: Networking, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: dholbert, Assigned: dholbert)
Details
(Whiteboard: [build_warning])
Attachments
(1 file)
|
1.71 KB,
patch
|
Biesinger
:
review+
|
Details | Diff | Splinter Review |
I get 11 copies (22 lines) of this build warning, when building mozilla-central (using g++ version 4.3.4):
> ../../../mozilla/netwerk/test/TestCommon.h:62: warning: 'void PumpEvents()' defined but not used
> ../../../mozilla/netwerk/test/TestCommon.h:73: warning: 'void QuitPumpingEvents()' defined but not used
We get those functions because those functions are declared to be static in that header -- this means that any CPP file that #includes the header but doesn't use the functions will trigger a warning.
The attached patch fixes this by declaring the functions as "static inline" instead of just "static". This means they won't get compiled for any CPP files that don't use them. (It also means they'll potentially get compiled multiple times for files that do use them, but that's not a big deal because (a) this is just testing code, and (b) these functions are tiny anyway).
The patch also includes a fix for a printf build warning in TestURLParser.cpp, in the same directory. ("warning: format '%p' expects type 'void*', but argument 2 has type 'nsIURLParser*'")
| Assignee | ||
Comment 1•16 years ago
|
||
(In reply to comment #0)
> We get those functions because those functions are declared to be static in
(er, I meant "We get those warnings")
| Assignee | ||
Updated•16 years ago
|
Attachment #412910 -
Attachment is patch: true
Attachment #412910 -
Attachment mime type: application/octet-stream → text/plain
Attachment #412910 -
Flags: review?(bzbarsky)
Updated•16 years ago
|
Attachment #412910 -
Flags: review+
| Assignee | ||
Comment 2•16 years ago
|
||
Comment on attachment 412910 [details] [diff] [review]
fix: use "static inline" instead of "static"
Thanks for the quick review, biesi! (/me un-sets r? for bz)
Attachment #412910 -
Flags: review?(bzbarsky)
| Assignee | ||
Comment 3•16 years ago
|
||
Assignee: nobody → dholbert
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
| Assignee | ||
Updated•16 years ago
|
Whiteboard: [build_warning]
You need to log in
before you can comment on or make changes to this bug.
Description
•