This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64877] New: strange warning message from -Waddress
- From: "tromey at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 30 Jan 2015 16:56:28 +0000
- Subject: [Bug c++/64877] New: strange warning message from -Waddress
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64877
Bug ID: 64877
Summary: strange warning message from -Waddress
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: tromey at gcc dot gnu.org
I found a spot in firefox that tries to prevent hiding
using:
explicit ScopedGLWrapper(GLContext* gl)
: mIsUnwrapped(false)
, mGL(gl)
{
MOZ_ASSERT(&ScopedGLWrapper<Derived>::Unwrap == &Derived::Unwrap);
[...]
void Unwrap() {
...
}
gcc 5 warns about this assert:
/home/tromey/firefox-git/gecko-dev/gfx/gl/ScopedGLHelpers.h:35:54: error: the
address of âvoid mozilla::gl::ScopedGLWrapper<Derived>::Unwrap() [with Derived
= mozilla::gl::ScopedGLState]â will never be NULL [-Werror=address]
MOZ_ASSERT(&ScopedGLWrapper<Derived>::Unwrap == &Derived::Unwrap);
^
The message here is strange. Whether or not the address can be NULL
is not an issue. I don't see why -Waddress ought to warn here at all.