RE: #line directive and -D option

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

 



On Wednesday 2008-12-17 03:37, John (Eljay) Love-Jensen wrote:

>Hi Hiroki,
>
>The __FILE__ is based on what you pass.
>
>gcc -c foo.c
>__FILE__ is "foo.c"
>
>gcc -c ././././foo.c
>__FILE__ is "././././foo.c"
>
>If you don't want the prefix, don't append the prefix.

Well sometimes that just is not possible; for example when
you do an out-of-srcdir build in an autotools project, aka:

	mkdir obj
	cd obj
	../configure

then the compiler will be invoked with lots of ../${filename}.c.
That's why I use basename.

[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