This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/13482] New: -Wall -W and -Wunused do not behave as documented


$ 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]