Re: #define in prefix.pch (was -Wall)
Re: #define in prefix.pch (was -Wall)
- Subject: Re: #define in prefix.pch (was -Wall)
- From: "Patrick Stinson" <email@hidden>
- Date: Thu, 5 Jun 2008 12:42:10 -0800
Try explicitly including the prefix.pch in each file that needs.
Depending on the mechanics of the xcode pch stuff it should work.
In practice I like to stick tightly to the rule that only third-party
headers go into the pch and everything else I've written goes into my
own globals.h, which I explicitly include using the project root like
this:
#include <src/common/globals.h>
The globals.h does any macro madness you may want like platform
detection, simple typedefs, etc. It also should remain a top-level
header for your project, meaning it does not include anything else
from your project except the pch, and should not allocate any memory.
have fun.
On Thu, Jun 5, 2008 at 12:16 PM, Stuart Malin <email@hidden> wrote:
> I am now trying to use
> #define USE(x) x = x;
> rather than the #pragma or the __unused__ attribute.
> If I put this in the source file, it works. I tried putting this in the
> prefix.pch file, and it doesn't have an effect. Can I put a #define in the
> prefix.pch file?
>
> On Jun 5, 2008, at 8:40 AM, Mark Wagner wrote:
>
> On 6/4/08, Stuart Malin <email@hidden> wrote:
>
> Is there some other way I can inform the
> compiler (and a future maintainer) that the parameter is intentionally not
> used?
>
> Our code has the following macro, designed to defeat even the smartest
> optimizing compiler:
> #define USE(x) {Int _y_ = ((Int)(long)&_y_, x, 1);}
> It also has simpler versions of the macro for compilers that don't
> need the complexity.
> --
> Mark
>
> _______________________________________________
> 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
>
_______________________________________________
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