Mail Archives: cygwin/2001/07/27/09:51:00
Hi Guys,
I think I found a problem in connection with
gcc 'token-pasting' operator (##)
$ gcc -v
Reading specs from /usr/lib/gcc-lib/i686-pc-cygwin/2.95.3-5/specs
gcc version 2.95.3-5 (cygwin special)
I use cygwin v1.3.2 under NT 4.0 Service Pack 6.
Here's a little example to show its failure:
( obviously it has no meaning, I used it just for demonstrating the
problem )
--------------------
#define Glue(a,b) a##b
#define TestDef /usr/X11R6
int main( int argc, char *argv[] )
{
printf( "%s", Glue( TestDef,/lib ) );
return 0;
}
---------------------
Feeding this to gcc it produces the following on my computer:
---------------------
$ gcc -E test.c
# 1 "test.c"
int main( int argc, char *argv[] )
{
printf( "%s", /usr/X11R6 /lib );
return 0;
}
---------------------
Please notice the gap between '/usr/X11R6' and '/lib'.
It only happens if the first paramter of the 'Glue' macro is
another macro. If I use a literal it works fine!
I also tested it on Linux and it worked fine there.
Thanks for your help and best regards,
Bela
ps.: Can you please cc answers to me, because I'm not on the list, yet !
Thanks !
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Bug reporting: http://cygwin.com/bugs.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -