This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13482] New: -Wall -W and -Wunused do not behave as documented
- From: "boris at kolpackov dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 23 Dec 2003 20:50:29 -0000
- Subject: [Bug c++/13482] New: -Wall -W and -Wunused do not behave as documented
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
$ cat >test.cpp
void bar ();
void foo (int const& a)
{
try
{
bar ();
}
catch (int const& e)
{
bar ();
}
}
$ g++ --version
g++ (GCC) 3.3 (Debian)
$ g++ -c ./test.cpp
$ g++ -Wunused -c ./test.cpp
$ # would expect two warnings here
$ g++ -Wall -c ./test.cpp
$ # would expect two warnings here
$ g++ -W -Wunused -c ./test.cpp
test.cpp: In function `void foo(const int&)':
test.cpp:4: warning: unused parameter `const int&a'
$ # doc never said I should use -W to make -Wunused work
$ # only one warning
$ # also note how ugly `const int&a' looks
$ g++ -W -Wall -c ./test.cpp
test.cpp: In function `void foo(const int&)':
test.cpp:4: warning: unused parameter `const int&a'
$ # again only one warning
--
Summary: -Wall -W and -Wunused do not behave as documented
Product: gcc
Version: 3.3.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: boris at kolpackov dot net
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i386-gnu-linux
GCC host triplet: i386-gnu-linux
GCC target triplet: i386-gnu-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13482