Supporting Multiple SDK's Without Warnings
Supporting Multiple SDK's Without Warnings
- Subject: Supporting Multiple SDK's Without Warnings
- From: Nick Nallick <email@hidden>
- Date: Sat, 1 Jul 2006 09:43:38 -0600
I have some code that builds for older OS versions using CodeWarrior
and also for 10.3.9 and later using Xcode and GCC 4. It contains a
number of patterns similar to the one below. The idea is to when
possible, avoid a runtime check for a function that must be present.
Rect picFrame;
if (REQUIRE_PANTHER || QDGetPictureBounds)
QDGetPictureBounds(picHdl, &picFrame);
else
picFrame = (**picHdl).picFrame;
I'm presently trying to clean up extraneous warnings in this code and
the above gives me the following warning.
warning: the address of 'Rect* QDGetPictureBounds(Picture**,
Rect*)', will always evaluate as 'true'
Given that for Xcode REQUIRE_PANTHER will also always evaluate as
true this seems rather pointless, not to mention the fact that it's
kind of the point of the whole thing. I really just want the
compiler to shut up and optimize out everything but the function
call. Can anybody suggest another way to do this without the warning?
Thanks,
Nick Nallick
_______________________________________________
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