• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: __FILE__ relative path?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >__FILE__ relative path? (From: Alex Eddy <email@hidden>)

  • Prev by Date: Re: Connections in Cocoa Document-based application
  • Next by Date: Re: Connections in Cocoa Document-based application
  • Previous by thread: __FILE__ relative path?
  • Next by thread: Debugger and STL
  • Index(es):
    • Date
    • Thread