Closed
Bug 832554
Opened 11 years ago
Closed 11 years ago
Fix android build warnings for -Wunused-function (e.g. gfxFontMissingGlyphs.cpp:148:1: warning: 'void DrawHexChar(gfxContext*, const gfxPoint&, uint32_t)' defined but not used)
Categories
(Core :: Graphics: Text, defect)
Tracking
()
RESOLVED
FIXED
mozilla21
People
(Reporter: dholbert, Assigned: dholbert)
References
(Blocks 1 open bug, )
Details
Attachments
(1 file, 1 obsolete file)
4.60 KB,
patch
|
BenWa
:
review+
|
Details | Diff | Splinter Review |
Build warning on Android: { gfx/thebes/gfxFontMissingGlyphs.cpp:148:1: warning: 'void DrawHexChar(gfxContext*, const gfxPoint&, uint32_t)' defined but not used [-Wunused-function] } This function is only used in an "#ifndef MOZ_GFX_OPTIMIZE_MOBILE" chunk, ever since this cset... https://hg.mozilla.org/mozilla-central/rev/082875fdb725 ...so we should make the function-definition #ifndef MOZ_GFX_OPTIMIZE_MOBILE as well.
Assignee | ||
Comment 1•11 years ago
|
||
Assignee | ||
Comment 2•11 years ago
|
||
I found two more instances of this -- that is, two more static helper functions in the same directory that are currently defined unconditionally but aren't called if ANDROID or MOZ_GFX_OPTIMIZE_MOBILE are defined. Bundling those into this bug, as well. The three warnings (including the one from comment 0) are: { ../../../gfx/thebes/gfxFontMissingGlyphs.cpp:148:1: warning: 'void DrawHexChar(gfxContext*, const gfxPoint&, uint32_t)' defined but not used [-Wunused-function] ../../../gfx/thebes/gfxFT2Fonts.cpp:43:1: warning: 'PRLogModuleInfo* GetFontLog()' defined but not used [-Wunused-function] ../../../gfx/thebes/gfxUtils.cpp:216:1: warning: 'already_AddRefed<gfxDrawable> CreateSamplingRestrictedDrawable(gfxDrawable*, gfxContext*, const gfxMatrix&, const gfxRect&, const gfxRect&, gfxASurface::gfxImageFormat)' defined but not used [-Wunused-function] }
Summary: Android build warning: gfxFontMissingGlyphs.cpp:148:1: warning: 'void DrawHexChar(gfxContext*, const gfxPoint&, uint32_t)' defined but not used [-Wunused-function] → Fix android build warnings for -Wunused-function (e.g. gfxFontMissingGlyphs.cpp:148:1: warning: 'void DrawHexChar(gfxContext*, const gfxPoint&, uint32_t)' defined but not used)
Assignee | ||
Updated•11 years ago
|
Attachment #704150 -
Attachment is obsolete: true
Attachment #704150 -
Flags: review?(vladimir)
Assignee | ||
Comment 3•11 years ago
|
||
Attachment #704663 -
Flags: review?(bgirard)
Assignee | ||
Updated•11 years ago
|
OS: Linux → Android
Hardware: x86_64 → ARM
Comment 4•11 years ago
|
||
Comment on attachment 704663 [details] [diff] [review] fix v2 This is the kind of stuff I would rather just silence the compiler. It should be optimized out of the compilation unit at build time. But I don't object to this change.
Attachment #704663 -
Flags: review?(bgirard) → review+
Assignee | ||
Comment 5•11 years ago
|
||
(In reply to Benoit Girard (:BenWa) from comment #4) > This is the kind of stuff I would rather just silence the compiler Well -- in code without #ifdefs, this warning would be telling you "Here's a static function that's never called, anywhere. Either you meant to call it and forgot (BUG!), or it's dead code. (not a big problem, but worth cleaning up)" That's a very useful thing for the compiler to tell you about. (Unfortunately, since the compiler sees code after #ifdef-processing has happened, I'm not sure it can distinguish that situation from this situation where there are a bunch of platform-specific #ifdefs enabling/disabling various chunks of code.)
Assignee | ||
Comment 6•11 years ago
|
||
and: thanks for the quick review turnaround! :)
Assignee | ||
Comment 7•11 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/33e8b01d811a
Comment 8•11 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/33e8b01d811a
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
You need to log in
before you can comment on or make changes to this bug.
Description
•