This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

String concatenation


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?

Thanks,
Srivatsan



____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]