[Bug libstdc++/17922] New: Spurious warnings
jm at bourguet dot org
gcc-bugzilla@gcc.gnu.org
Sun Oct 10 13:55:00 GMT 2004
$ cat bug.cc
#include <istream>
void f(std::ios_base::seekdir dir)
{
switch (dir) {
case std::ios_base::beg:
break;
case std::ios_base::cur:
break;
case std::ios_base::end:
break;
}
}
$ LANG=C g++-3.4.2 -Wall -c bug.cc
bug.cc: In function `void f(std::_Ios_Seekdir)':
bug.cc:12: warning: enumeration value `_S_ios_seekdir_end' not handled in switch
bug.cc:12: warning: case value `0' not in enumerated type `_Ios_Seekdir'
bug.cc:12: warning: case value `1' not in enumerated type `_Ios_Seekdir'
bug.cc:12: warning: case value `2' not in enumerated type `_Ios_Seekdir'
These warnings are not very usefull: the code cover all the standard
values and only them but the compiler complaim about missing value and values
not in the type.
Yours,
--
Jean-Marc
--
Summary: Spurious warnings
Product: gcc
Version: 3.4.2
Status: UNCONFIRMED
Severity: minor
Priority: P3
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jm at bourguet dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC build triplet: i686-pc-linux-gnu
GCC host triplet: i686-pc-linux-gnu
GCC target triplet: i686-pc-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=17922
More information about the Gcc-bugs
mailing list