Closed Bug 874736 Opened 8 years ago Closed 8 years ago

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


(Core :: Graphics: Layers, defect)

Not set





(Reporter: dholbert, Assigned: Six)


(Blocks 1 open bug)



(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]
} 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 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
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.
Closed: 8 years ago
Flags: needinfo?(dholbert)
Resolution: --- → DUPLICATE
Duplicate of bug: 876661
Backed out:

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.