This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PR preprocessor/33305: We should warn about empty macro arguments
- From: Andrew Haley <aph at redhat dot com>
- To: tromey at redhat dot com
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 25 Jun 2008 10:56:26 +0100
- Subject: Re: PR preprocessor/33305: We should warn about empty macro arguments
- References: <48594AE3.2020702@redhat.com> <m3d4m6tlv3.fsf@fleche.redhat.com>
Tom Tromey wrote:
>>>>>> "Andrew" == Andrew Haley <aph@redhat.com> writes:
>
> Andrew> In order not to break bootstrapping it requires my two
> Andrew> previously posted patches to c-common.c and tree.c which
> Andrew> removed the use of empty macro arguments.
>
> I can't approve those.
Well, OK, but I can't check in the warning without checking in these first.
I guess it's borderline obvious/trivial.
> Andrew> Bootstrapped x86_64_linux_gnu. OK for trunk?
>
> Andrew> + cpp_error (pfile, CPP_DL_PEDWARN,
> Andrew> + "invoking macro %s arg %d: "
> Andrew> + "empty macro arguments are undefined"
> Andrew> + " in ISO C90 and ISO C++98",
> Andrew> + NODE_NAME (node),
> Andrew> + src->val.arg_no);
>
> I would prefer "arg %d" to be spelled out. I don't think we
> abbreviate "argument" anywhere else in errors.
Spelled out as "argument"? OK. Sheesh, you guys are picky. :-)
> Andrew> PR preprocessor/33305
> Andrew> * gcc.dg/cpp/c90-empty-macro-args.c: New test.
>
> My understanding is that we try to have a test for each compilation
> mode, in cases where that matters. I.e., in this case, a separate
> copy of the new test, compiled with -std=c99, which would then expect
> no errors.
Same test, c99 mode, no errors. OK.
Andrew.