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


On Fri, Sep 20, 2002 at 07:23:47PM +0100, Neil Booth wrote:
> >From my testing, this patch has the desired behaviour in all cases, as
> far as I can see.

Nice.

>        * 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.

zw


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