Re: Incorrect warning
Re: Incorrect warning
- Subject: Re: Incorrect warning
- From: Steve Mills <email@hidden>
- Date: Tue, 16 Nov 2004 09:21:46 -0600
On Nov 16, 2004, at 01:41, Chris Espinosa <email@hidden> wrote:
The compiler absolutely cares about signedness when doing comparisons.
[snip]
You mean there's actually an equality operator that compares 32 bits
when the data is signed and another equality operator that compares the
*same* 32 bits when the data is unsigned? How completely odd.
Nope, enums are by default ints, which are by definition signed.
I suppose I could turn the enums back into const's, which is how they
started life many years ago, but then had to be changed to an enum when
we started the cross-platform thang. Oh man.
Since C++ doesn't allow you to declare the type of an enumeration, your
two choices are to a) don't use -Wsign-compare or b) explicitly cast
your enumerals to (DescType) in your comparisons.
Arg. I like it a lot better when it just works in CodeWarrior. I like
having the warning on in Xcode for *times when it really matters*, but
for comparing 32-bit integer equality it really shouldn't care about
signs.
Steve Mills
Drummer, Mac geek
http://sjmills5.home.mchsi.com/
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden