Re: #line directive and -D option

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

 



Hi,

From: "John (Eljay) Love-Jensen" <eljay@xxxxxxxxx>
> Hi Hiroki,
> 
> Worked on my machine.
...
> Depending on your shell, you may need to escape the quotes, such as one of these two ways:
> -D MYNAME=\"macrotest\"
> -D MYNAME='"macrotest"'

Ah, above worked, thank you!


By the way, is there any method to strip strings prefix passed to
__FILE__ macro?  If .c file is specified by abosolute path, __FILE__
also prints absolute path:

$ cat macro-test.c 
#include <stdio.h>
int main(void)
{
  printf ("%s: .... \n", __FILE__);
  return 0;
}
$ gcc `pwd`/macro-test.c -o macro-test
$ ./macro-test
/home/kaminaga/tmp/dir/macro-test.c: .... 

and I was looking for e.g. environment variable that would strip
prefix such as in patch -p option...


Best Regards,

(Hiroki Kaminaga)
t
--

[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