This is the mail archive of the gcc@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]

Re: warning: pasting would not give a valid preprocessing token


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


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