This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Token Pasting operator
- From: "Srivatsan S" <vatsan007 at lycos dot com>
- To: gcc at gnu dot org
- Date: Wed, 30 Jul 2003 01:38:00 -0400
- Subject: Token Pasting operator
- Organization: Lycos Mail (http://www.mail.lycos.com:80)
- Reply-to: vatsan007 at lycos dot com
Hi,
I have the following piece of code which compiles properly with gcc version 2.95.3, but gives warnings in 3.2.3. This code piece uses token pasting operator in C (##) for string concatenation.
#define SETVALUE(x,y) x##y
main()
{
char z[20];
sprintf(z, "%s", SETVALUE("test ", " the program" ));
printf("z=%s \n", z );
}
How to compile this successfully on 3.2.3 without warnings?
I am using RedHat Linux 9 on a 2.4.20-8 kernel.
Please CC me on your reply as I am not a member of the list.
Thanks,
Srivatsan
____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005