This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: cpplib: Fix funlike macros and -Wtraditional
- From: Zack Weinberg <zack at codesourcery dot com>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: John David Anglin <dave at hiauly1 dot hia dot nrc dot ca>, gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 Sep 2002 13:36:54 -0700
- Subject: Re: cpplib: Fix funlike macros and -Wtraditional
- References: <20020920182347.GA7443@daikokuya.co.uk>
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