Closed Bug 795655 Opened 7 years ago Closed 7 years ago

gfx/2d/RecordedEvent.h:60:20: warning: ‘std::string mozilla::gfx::StringFromPtr(mozilla::gfx::ReferencePtr)’ defined but not used [-Wunused-function]

Categories

(Core :: Graphics, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla19

People

(Reporter: dholbert, Assigned: dholbert)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 1 obsolete file)

For every file that #includes RecordedEvent.h, I get this build warning:
{
gfx/2d/RecordedEvent.h:60:20: warning: ‘std::string mozilla::gfx::StringFromPtr(mozilla::gfx::ReferencePtr)’ defined but not used [-Wunused-function]
}

This function was unused when it was checked in, in https://hg.mozilla.org/mozilla-central/rev/ed2e2da7d098 and it's still unused, as shown by this MXR search:
https://mxr.mozilla.org/mozilla-central/search?string=StringFromPtr

So, we should just remove it.
Attached patch fix (obsolete) — Splinter Review
Assignee: nobody → dholbert
Status: NEW → ASSIGNED
Attachment #666286 - Flags: review?
Attachment #666286 - Flags: review? → review?(bas.schouten)
Bas, review-ping?  (this code is still unused, & hence presumably-removable)
(In reply to Daniel Holbert [:dholbert] from comment #2)
> Bas, review-ping?  (this code is still unused, & hence presumably-removable)

It is not reusable, it's used by the Azure drawing debugger code which we don't build. Marking it inline will prevent this warning I suppose?
(In reply to Bas Schouten (:bas) from comment #3)
> It is not reusable, it's used by the Azure drawing debugger code which we
> don't build.

Are you sure?  Note the MXR search from comment 1, which shows that the string "StringFromPtr" only occurs once, at this function's definition.
(or, maybe you meant that this debugger code lives outside of mozilla-central somewhere?)
Bas, ping on comment 4.

(Making it inline would work for me, but I first want to clarify what/where is the debugger code you spoke of in comment 3, to be sure it does actually use this)
(In reply to Daniel Holbert [:dholbert] from comment #6)
> Bas, ping on comment 4.
> 
> (Making it inline would work for me, but I first want to clarify what/where
> is the debugger code you spoke of in comment 3, to be sure it does actually
> use this)

https://hg.mozilla.org/users/bschouten_mozilla.com/player2d/file/22fe7a311e07
Attached patch fix v2Splinter Review
Ah, thanks for the reference, Bas.

I suspect this function really wants to live in that debugger code, since that's the only place it's used.  But for now, marking it as "inline" makes things better (removing ~20 lines of build-warning-spam in my build)
Attachment #666286 - Attachment is obsolete: true
Attachment #666286 - Flags: review?(bas)
Attachment #676233 - Flags: review?
Attachment #676233 - Flags: review? → review?(bas)
Comment on attachment 676233 [details] [diff] [review]
fix v2

Review of attachment 676233 [details] [diff] [review]:
-----------------------------------------------------------------

I have multiple projects which use it, I want them to build individually so putting it here seemed to make sense rather than duplicating it.
Attachment #676233 - Flags: review?(bas) → review+
Fair enough. Thanks!
https://hg.mozilla.org/mozilla-central/rev/4051d30c8f35
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Flags: in-testsuite-
Resolution: --- → FIXED
Target Milestone: --- → mozilla19
Blocks: 839269
You need to log in before you can comment on or make changes to this bug.