Re: __BASENAME__?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi John

> Does gcc have a way to emit just the basename of __FILE__?

Sort of.

This command line:
g++ test.cpp

Results in this __FILE__
"test.cpp"

This command line:
g++ ~/dev/breitenbach/test.cpp

Results in this __FILE__
"/home/eljay/dev/breitenbach/test.cpp"

(The '~' is pre-expanded to $HOME by my shell.)

So you pretty much get what you give.

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux