This is the mail archive of the
mailing list for the GCC project.
Re: patch/rfc: A better way to do variadic functions
- To: Zack Weinberg <zackw at stanford dot edu>
- Subject: Re: patch/rfc: A better way to do variadic functions
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Mon, 7 May 2001 19:48:19 +0100
- Cc: gcc-patches at gcc dot gnu dot org
- References: <20010507101841.I32266@stanford.edu>
Zack Weinberg wrote:-
> In the shower this morning, it dawned on me how to get around that.
I seem to recall this isn't your first inspiration born in the shower
> This patch creates some new ansidecl.h macros which let us write
> error VPARAMS ((const char *msgid, ...))
> diagnostic_context dc;
> VA_OPEN (ap, msgid);
> VA_FIXEDARG (ap, const char *, msgid);
> /* body of function */
> VA_CLOSE (ap);
> which is a third the size, easier to read, and clearer as to what's
> going on. You can put the declaration of diagnostic_context after the
> VA_FIXEDARG call(s) if you like, too.
Looks good to me at least, Zack.