This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
-Wextra and enumerator/non-enumerator in conditional expressions
- From: "Ching, Jimen \(US SSA\)" <jimen dot ching at baesystems dot com>
- To: <gcc at gcc dot gnu dot org>
- Date: Wed, 4 Apr 2007 14:49:21 -1000
- Subject: -Wextra and enumerator/non-enumerator in conditional expressions
Hi all,
I'm using g++ 4.1.1 under Fedora Core 5 on an Intel system. I'm
compiling
the following code with "g++ -Wextra tst.cpp".
----------------------------------------
enum my_enum { FOO = 10, BAR, BAZ };
int
main()
{
my_enum e = BAR;
while (e == 15);
for (;e == 15;);
return e == 15;
}
----------------------------------------
According to the manual, I should be getting a warning, but I don't.
Did
I misunderstand the manual?
Thanks in advance for any help.
--jc
--
BAE Systems NS I&S
810 Richards Street, Ste. 124
Honolulu, HI 96813
Phone: 808 441-2563