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: PR preprocessor/33305: We should warn about empty macro arguments


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.


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