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]

Re: [gcc-as-cxx] enum conversion to int


On Tue, 5 Jan 2010, Ian Lance Taylor wrote:

Matt <matt@use.net> writes:

Yes, was I pasted was a local change. I was trying to eliminate the
implicit cast to int from the enum type, which was causing my
--enable-werror build to fail. At this point, I think the better
option would be to break up the enum values into indivdual #defines
and do a typedef df_changeable_flags int;

Don't use #defines. Enums give better debug info by default. typedef df_changeable_flags int is fine if that seems necessary. Right now the code simply doesn't use the df_changeable_flags type any time there is more than one flag.

Okay, good to know about the better debuggability of enums. If the flags are supposed to be mutually exclusive, then the code in my other email where two flags are added together seems contrary.


Regardless, does this mean that the bit-wise operations for set_flags and clear_flags could be changed to simple assignments? That would indeed fix this issue in a nice way.

--
tangled strands of DNA explain the way that I behave.
http://www.clock.org/~matt


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