Re: __FILE__ relative path?
Re: __FILE__ relative path?
- Subject: Re: __FILE__ relative path?
- From: Eric Albert <email@hidden>
- Date: Thu, 10 Mar 2005 10:48:46 -0800
On Mar 10, 2005, at 6:07 AM, Alex Eddy wrote:
Is it possible to get gcc to output just the source file name for
__FILE__, without the entire absolute path?
e.g. "foo.c" instead of "Users/somebody/project/source/subfolder/
foo.c"?
Comparing some large source trees built with both Codewarrior and
gcc, it looks like CW does this, but I don't see any flag to make
gcc do it...
GCC uses the path you give it. So if you tell it to compile foo.c,
__FILE__ will be foo.c, but if you tell it to compile /Users/somebody/
foo.c, __FILE__ will be /Users/somebody/foo.c.
If you're building from within Xcode, I don't think there's any way
to change the type of path (relative vs. full) that Xcode passes to
the compiler, though I might be wrong about that.
Hope this helps,
Eric
_______________________________________________
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