Re: [OFFTOPIC] gcc and macros var args in rh7



On Fri, 22 Dec 2000, Arturo Tena wrote:

> 
> Hello!
> 
> I've found some weird things in Red Hat Linux 7.0 and its gcc
> (gcc-2.96-69).
> 
> The following simple program shows a warning:
> 
> 
> $ cat a.c
> #define aaa(args...) ccc(## args)
> int main (void) { return 0; }
> $ gcc a.c
> a.c:1:25: warning: nothing can be pasted after this token
> $

>From the gcc docs, it says that when you use ## like this, it will delete
the previous token if args is empty.  So maybe try removing the ##, as you
probably don't want to remove a token when args is empty.  That is, you
probably want aaa() to expand to ccc(), rather than ccc).

James.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]