This is the mail archive of the gcc@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]

-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


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