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

Re: cpplib: Fix funlike macros and -Wtraditional


Zack Weinberg wrote:-

> >        * cppmacro.c: Don't warn about function-like macros without
> >        '(' during pre-expandion.
> Typo here                    ^
> 
> > +#define f(x) x
> > +#define g(x) x / 2
> > +f(g) (3)	    /* { dg-bogus "must be used with arguments" } */
> > +f 2		    /* { dg-warning "must be used with arguments" } */
> > +f(g) 3		    /* { dg-warning "must be used with arguments" } */
> 
> Suggest also
> 
> #define h(a, b) a(b)
> h(f, 3)	     /* { dg-bogus "must be used with arguments" } */
> 
> this is the construct used by md5.c.

OK, I'll add this (I'd already committed the patch).

Neil.


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