On 5/9/05, Shachar Shemesh <[EMAIL PROTECTED]> wrote:
> Oleg Goldshmidt wrote:
> 
> >Shachar,
> >
> >
> 
> >I don't understand this statement. I suspect that you have a different
> >mental picture of "undefined behavior". The official "definition of
> >undefined behavior" is that *anything* may happen.
> >
> >
> No. The official definition of "undefined behavior" is that the behavior
> is implementation specific. Luckily, the same compiler that defines the
> specific case is also the one that provides the "va_start"
> implementation, and so I really don't think that "implementation
> specific" is reason enough to not support it.

Your definition of "undefined" sounds reasonable, but in practical
terms, "undefined" might also mean things like "may produce
random results, depending on what happened to be on the stuck
when a particular command sequence was executed, and you
can't blame the compiler for producing this code"  (e.g. a bug
either in my program or the Visual Studio .NET 2003 C++
I had to fix/work-around just this morning).

> It MAY be possible that the man is warning about passing actual arrays
> and functions, in which case all I have to say is:
> 1. I totally understand why those would be impossible "last arguments"
> for va_start, just like I understand why "register" is impossible. If
> you like, I'll explain.
> 2. Unlike "register", I know of no way to actually pass either arrays OR
> functions (as opposed to array pointers and function pointers) to a
> function. If someone can send me the function declaration syntax, I can
> check.

I don't know about such a syntax either.
I can understand that pointers-to-code (i.e. function pointers) might
not be always convertable to pointers-to-data on some architectures (e.g.
different address-space widths for code and data) and therefore the C++
standard restricts casting between the two in general.

> >I don't have a copy of the Standard at hand, that is why I resorted to

Here is what I believe to be the draft which was voted on:
http://www.open-std.org/jtc1/sc22/open/n2356/
The standard itself costs money but the draft is free on-line and
generally considered close enough to the actual standard itself.

BTW - a first TR ("Technical Recommandation"?) is in the oven
and making sounds of being ready to serve relativelly soon.

> Up until this point that worked for me. So far, the evidence before me
> seems to suggest you are wrong, but if you find the standard, I'll
> gladly see the error of my ways. I'll just mention that it will not be
> the first time that the C++ standard dictates things which are counter
> productive.

What's counter-productive in the standard here?

Be aware that the committee which sets the standard tries to accomodate
for many situations which many people won't think about off the top of their
head.

> 
> >I have a suggestion. If you post your question to
> >comp.lang.c++.moderated or to an appropriate gcc forum someone there
> >will explain what happens, and probably quote the Standard to
> >you. I'll be happy to learn what the authoritative answer is.
> >
> >
> It's been ages since I used nntp, but I'll give it a try.

No need to use NNTP (if you'll find a useful NNTP server to use it with at all).
Google groups and gmane.org (among others) can give you pretty useful
web-interface for these groups.

> 
>           Shachar

--Amos

================================================================To unsubscribe, 
send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to