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: [PATCH,c++] introduce cp_build_function_call_nary


On Wed, 26 May 2010, Mark Mitchell wrote:

> Nathan Froyd wrote:
> 
> > 	* cp-tree.h (cp_build_function_call_nary): Declare.
> > 	* typeck.c (cp_build_function_call_nary): Define.
> 
> I like this idea, but I think that instead of "nargs", a NULL-terminated
> list of trees is a more robust way of expressing this interface.  A
> NULL_TREE argument isn't valid, so I don't think that's ambiguous, and I
> think it's easier to get:
> 
>   cp_build_function_call_nary (..., arg1, arg2, NULL_TREE);
> 
> right when you add in "arg3", then it is to remember to change the
> number-of-arguments parameter.

If adding a variadic function with NULL-termination convention to GCC, 
please also mark it with ATTRIBUTE_SENTINEL so that missing NULL 
termination can be detected when GCC is built.

-- 
Joseph S. Myers
joseph@codesourcery.com


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