Closed Bug 874736 Opened 11 years ago Closed 11 years ago

98 lines of GCC build warnings from -Woverloaded-virtual in gfx/layers/composite, due to two CompositableHost::EnsureTextureHost methods

Categories

(Core :: Graphics: Layers, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 876661

People

(Reporter: dholbert, Assigned: Six)

References

(Blocks 1 open bug)

Details

Attachments

(2 files)

I get nearly 100 lines of GCC buildwarning spam in gfx/layers/composite, from -Woverloaded-virtual.

The warnings look like:
{
In file included from /scratch/work/builds/mozilla-inbound/mozilla/gfx/layers/composite/CompositableHost.cpp:6:0:
/scratch/work/builds/mozilla-inbound/mozilla/gfx/layers/composite/CompositableHost.h:153:16: warning: ‘virtual void mozilla::layers::CompositableHost::EnsureTextureHost(mozilla::layers::ISurfaceAllocator*, const mozilla::layers::TextureInfo&, const nsIntRect&)’ was hidden [-Woverloaded-virtual]
In file included from /scratch/work/builds/mozilla-inbound/mozilla/gfx/layers/composite/CompositableHost.cpp:7:0:
/scratch/work/builds/mozilla-inbound/mozilla/gfx/layers/composite/ImageHost.h:51:16: warning:   by ‘virtual void mozilla::layers::ImageHostSingle::EnsureTextureHost(mozilla::layers::TextureIdentifier, const mozilla::layers::SurfaceDescriptor&, mozilla::layers::ISurfaceAllocator*, const mozilla::layers::TextureInfo&)’ [-Woverloaded-virtual]
}

http://stackoverflow.com/questions/9995421/gcc-woverloaded-virtual-warnings has an explanation for what's going on here.

IIRC you can suppress these warnings by adding a "using CompositableHost::EnsureTextureHost;" declaration to the affected classes.
Attached file warnings
Attaching a log of all these warnings.
Looks like this was introduced a week ago by http://hg.mozilla.org/mozilla-central/rev/a1bb5799f8ee which added the second EnsureTextureHost declaration.

I'm using GCC 4.8, BTW (though I think this affects all GCC versions; not sure about other compilers).
Summary: 98 lines of GCC build warnings from -Woverloaded-virtual in gfx/layers/composite/ → 98 lines of GCC build warnings from -Woverloaded-virtual in gfx/layers/composite, due to two CompositableHost::EnsureTextureHost methods
Looks ok on my linux64
Assignee: nobody → six.dsn
Status: NEW → ASSIGNED
Attachment #759171 - Flags: review?(nical.bugzilla)
Comment on attachment 759171 [details] [diff] [review]
Annotate "using CompositableHost::EnsureTextureHost;" to fix warnings with -Woverloaded-virtual in gfx/layers/composite

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

Looks like a good short term solution although it can probably be a bit confusing since it's a rather unusual pattern. The work I am doing on textures gets rid of EnsureTextureHost so this confusion about overloaded virtual methods will not stay in the code for too long (hopefully).
Attachment #759171 - Flags: review?(nical.bugzilla) → review+
Keywords: checkin-needed
daniel could you try the patch to confirm it is gone away on your machine?
Flags: needinfo?(dholbert)
I actually don't get the build warning in up-to-date mozilla-central now (without this bug's patch -- I verified that my clone doesn't have the cset from comment 5).

So something else apparently fixed this (without the "using" declaration) -- looks like it was bug 876661 (which was really a dupe of this bug).  The patch there took a different approach -- renaming one of the methods.

I'm forward-duping this to that bug, and we should back out comment 5, since we don't need the "using" declaration now.
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Flags: needinfo?(dholbert)
Resolution: --- → DUPLICATE
Backed out: https://hg.mozilla.org/integration/mozilla-inbound/rev/0ae723d89b73

Thanks anyway for taking this, Arnaud, and sorry for the confusion!
OK if it's fixed it's okay for me even if it's not my patch that is being used :)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: