From mboxrd@z Thu Jan 1 00:00:00 1970 From: Byron Stanoszek To: Zack Weinberg Cc: Geoff Keating , gcc@gcc.gnu.org Subject: Re: warning: pasting would not give a valid preprocessing token Date: Sat, 12 Aug 2000 08:19:00 -0000 Message-id: References: <20000811233046.A18374@wolery.cumb.org> X-SW-Source: 2000-08/msg00277.html On Fri, 11 Aug 2000, Zack Weinberg wrote: > Very recent versions of gcc should not give that warning for the > specific case of , ## . Well, I just tried it on the August 11 snapshot. So unless you put in a patch over the night, it still issues those warnings. > You could also write your tprintf() macro like this: > > #define tprintf(args...) (snprintf(buff, BUFSIZ, args), (char *)buff) > > you'll still get an error for tprintf(/* nothing */) but > tprintf("string") will be fine. I could do that, and I thought about it; (sprintf(buff, args)) instead of snprintf because I want to remain compatible on systems that do not have glibc. But I was hoping to make the code easier to read by keeping that 'format' variable in there. Again, the only time I get that warning is when there are two tokens with string concatenation ("abc" "def", args...). GCC didn't complain about this before, so I was wondering if it could get fixed. Thanks. -- Byron Stanoszek Ph: (330) 644-3059 Systems Programmer Fax: (330) 644-8110 Commercial Timesharing Inc. Email: bstanoszek@comtime.com