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: Tom Tromey <tromey at redhat dot com>
- To: Andrew Haley <aph at redhat dot com>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 24 Jun 2008 18:10:56 -0600
- Subject: Re: PR preprocessor/33305: We should warn about empty macro arguments
- References: <48594AE3.2020702@redhat.com>
- Reply-to: tromey at redhat dot com
>>>>> "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.
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.
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.
Otherwise this is fine.
Tom