Re: backtrace
| From: | Sascha Schumann | Date: | Fri, 01 Sep 2000 13:29:51 +0000 |
| Subject: | Re: backtrace | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-31566@lists.php.net to get a copy of this message | ||
> I didn't say everything works if it compiles. I said copying va_list's
> works if it compiles.
See? It is not so hard to write what you mean and it avoids
misunderstandings.
> > > > 1.: "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.
> > >
> > > Where are you reading this? It sounds very odd and I assume it would be
> > > wrong (or otherwise useless to do) on every implementation.
> >
> > "7.15 Variable arguments <stdarg.h>," paragraph 3, page 262,
> > ISO/IEC 9899:1999.
>
> So it falls under the 'otherwise useless to do' IMO.
"it"? The part I quoted?
Most of these rules have been established, because some
implementations already behaved that way. The above rule has
no obvious inner logic, but it reflects common practice (at
least at the time of writing; this part dates back to 1990).
> That's mostly right. Essentially it assumes almost as much as va_list foo
> = va_list bar; assumes. The only difference is that in this case,
> implementations may also use arrays to represent va_list (because arrays
> cannot be lvalues).
The other significant difference is that the proposal is
aligned with the requirements of ISO C99, because it passes
ap by reference, not by value (which would have the earlier
described side effects).
- Sascha