public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: __FILE__
       [not found] <1011942357.21011.ezmlm@gcc.gnu.org>
@ 2002-01-24 23:10 ` christopher anthony sucato
  2002-01-25  8:10   ` __FILE__ John Love-Jensen
  0 siblings, 1 reply; 2+ messages in thread
From: christopher anthony sucato @ 2002-01-24 23:10 UTC (permalink / raw)
  To: gcc-help


Hi, i was hoping somebody could answer a quick question about the
predefined macro __FILE__. when i try using __FILE__ to print the full
name of the source file such as "/usr/me/code/main.cpp" all I get is
"main.cpp". Is there a way to get __FILE__ to display the full path name
to the file???

Thanks for your time,

Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: __FILE__
  2002-01-24 23:10 ` __FILE__ christopher anthony sucato
@ 2002-01-25  8:10   ` John Love-Jensen
  0 siblings, 0 replies; 2+ messages in thread
From: John Love-Jensen @ 2002-01-25  8:10 UTC (permalink / raw)
  To: christopher anthony sucato, gcc-help

Hi Christopher,

If you compile:
g++ -E foo.cpp

You will see __FILE__ is "foo.cpp".

If you compile
g++ -E /user/christopher/source/foo.cpp

You will see __FILE__ is "/user/christopher/source/foo.cpp".

You're in control.

--Eljay


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-01-25 16:10 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1011942357.21011.ezmlm@gcc.gnu.org>
2002-01-24 23:10 ` __FILE__ christopher anthony sucato
2002-01-25  8:10   ` __FILE__ John Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).