This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: warning: pasting would not give a valid preprocessing token
- To: Zack Weinberg <zack at wolery dot cumb dot org>
- Subject: Re: warning: pasting would not give a valid preprocessing token
- From: Byron Stanoszek <gandalf at winds dot org>
- Date: Sat, 12 Aug 2000 11:18:56 -0400 (EDT)
- cc: Geoff Keating <geoffk at cygnus dot com>, gcc at gcc dot gnu dot org
On Fri, 11 Aug 2000, Zack Weinberg wrote:
> Very recent versions of gcc should not give that warning for the
> specific case of , ## <rest argument>.
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