This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
-Wshadow -Werror
- From: Loren James Rittle <rittle at latour dot rsch dot comm dot mot dot com>
- To: libstdc++ at gcc dot gnu dot org
- Cc: rehsack at web dot de
- Date: Mon, 28 Jan 2002 11:30:54 -0600 (CST)
- Subject: -Wshadow -Werror
- Reply-to: rittle at labs dot mot dot com
Jens Rehsack reported to a FreeBSD mailing list (and David O'Brien
forwarded it to me) that these CXXFLAGS settings:
-W -Wall -Wbad-function-cast -Wcast-align -Wcast-qual -Wchar-subscripts
-Winline -Wmissing-prototypes -Wnested-externs -Wpointer-arith
-Wredundant-decls -Wshadow -Wstrict-prototypes -Wwrite-strings -Werror
causes this simple test case to fail against gcc 3.0.2 as built from
the FreeBSD ports system:
#include <iostream>
int main()
{
std::cout << "Hello world" << std::endl;
}
The issue was fixed on the mainline (due to random source reworking)
but still exists on the 3.0.X branch as built with plain FSF sources.
It appears that being marked as code within a system header does not
affect template instantiation that is actually triggered outside the
header. If this issue only arose when one was compiling libstdc++-v3
(as I first thought), then we could just say, "don't compile
libstdc++-v3 with both flags" but this issue impacts building user
code outside the library with strict warning flags.
Here is the original report with patch:
http://docs.freebsd.org/cgi/getmsg.cgi?fetch=1973092+0+archive/2002/freebsd-ports/20020127.freebsd-ports
I have reviewed the patch he provided and believe that it is
straightforward. It merely changes the inner use of the variable name
which is contained to a small localized scope.
Permission to synth a ChangeLog entry; perform required testing and
install on 3.0.X branch before 3.0.4 lockdown?
Regards,
Loren