--- Comment #4 from jason at gcc dot gnu dot org 2010-05-04 04:48 ---
In G++ 4.6 the surprising optimization will only be performed with
-fstrict-enums.
--
jason at gcc dot gnu dot org changed:
What|Removed |Added
--
--- Comment #3 from manu at gcc dot gnu dot org 2008-08-29 17:00 ---
In GCC 4.4 we warn about this with -Wconversion.
warning: the result of the conversion is unspecified because 32 is outside
the range of type MyTypes::Type
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37281
--- Comment #2 from gmorin1 at bloomberg dot net 2008-08-29 16:57 ---
I thought it was correct because it seems that the standard allows to cast
explicity inside the range. The range is not the one of the integral type but
the one of smallest bit field that can stop all the values. So
--- Comment #1 from pinskia at gmail dot com 2008-08-29 16:39 ---
Subject: Re: New: bad code generation with enum and -m32
This code is undefined as the value of 32 is outside the range of the
enum.
Sent from my iPhone
On Aug 29, 2008, at 9:29, "gmorin1 at bloomberg dot net"
<[EM