This is the mail archive of the gcc-bugs@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]

[Bug target/14557] va_list is automatically taken address-of when passed as argument


------- Additional Comments From falk dot hueffner at student dot uni-tuebingen dot de  2004-03-13 12:15 -------
Subject: Re:  va_list is automatically taken address-of
 when passed as argument

"zlomek at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org> writes:

> ------- Additional Comments From zlomek at gcc dot gnu dot org  2004-03-13 06:10 -------
> AFAIK it is incorrect to use "va_list *" so the code is wrong.

I don't see anything wrong with using "va_list *". The standard even says:

     It is permitted to create a pointer to a va_list and pass that
     pointer to another function, in which case the original function
     may make further use of the original list after the other
     function returns.

About passing by value it says:

     The object ap may be passed as an argument to another function;
     if that function invokes the va_arg macro with parameter ap, the
     value of ap in the calling function is indeterminate and shall be
     passed to the va_end macro prior to any further reference to ap.

Well, it doesn't invoke va_arg, so that should be fine, too.



-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=14557


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