Incorrect warning
Incorrect warning
- Subject: Incorrect warning
- From: Steve Mills <email@hidden>
- Date: Mon, 15 Nov 2004 12:11:22 -0600
Why is this a warning?
DescType x;
if(x != enumAddItemName && x != enumAddItemData) <--this line
generates this warning:
warning: comparison is always true due to limited range of data type
And this:
if(GetAEClass() == cUserScrollList || GetAEClass() ==
cUserTextScroller) <--this line
DescType GetAEClass(void) const { return one of many constants; }
generates this warning:
warning: comparison is always false due to limited range of data type
All constants used in our AppleEvent code are defined in one large
enum, e.g.:
enum {
enumAddItemName = 'ÜDDN',
enumAddItemData = 'ÜDDD',
cUserTextScroller = 'ÜTSc',
cUserScrollList = 'ÜScL',
etc...
};
In those 4, the first byte is umlaut-U, in case it doesn't make it
through mail. Those 2 warnings are obviously wrong, which makes me
wonder if Xcode/gcc will compile them out when optimizations are turned
on.
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