Closed Bug 529350 Opened 10 years ago Closed 10 years ago

Fix build warnings: "'void PumpEvents()' defined but not used", "'void QuitPumpingEvents()' defined but not used"

Categories

(Core :: Networking, defect)

x86
Linux
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: dholbert, Assigned: dholbert)

Details

(Whiteboard: [build_warning])

Attachments

(1 file)

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*'")
(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")
Attachment #412910 - Attachment is patch: true
Attachment #412910 - Attachment mime type: application/octet-stream → text/plain
Attachment #412910 - Flags: review?(bzbarsky)
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)
Landed: http://hg.mozilla.org/mozilla-central/rev/d74917fc48e3
Assignee: nobody → dholbert
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.