PR preprocessor/33305: We should warn about empty macro arguments

Tom Tromey tromey@redhat.com
Wed Jun 25 00:12:00 GMT 2008


>>>>> "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



More information about the Gcc-patches mailing list