Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

va_start rules on paramN

8 views
Skip to first unread message

TheDarkCoder

unread,
Nov 14, 2009, 12:44:15 PM11/14/09
to
Hello

in 7.15.1.4 , #4 :"If the parameter
parmNis declared with [...CUT...] or
with a type that is not compatible with the type that results after
application of the default
argument promotions, the behavior is undefined"

Does this mean that the type of paramN shall not be a character type
or _Bool or a short integer type?

Luca

Eric Sosman

unread,
Nov 14, 2009, 1:15:09 PM11/14/09
to

Yes, and `float' is also forbidden. The Rationale explains:

The parmN argument to va_start was intended to be an
aid to implementors writing the definition of a conforming
va_start macro entirely in C, even using pre-C89 compilers
(for example, by taking the address of the parameter). The
restrictions on the declaration of the 15 parmN parameter
follow from the intent to allow this kind of implementation,
as applying the & operator to a parameter name might not
produce the intended result if the parameter’s declaration
did not meet these restrictions.

--
Eric Sosman
eso...@ieee-dot-org.invalid

TheDarkCoder

unread,
Nov 16, 2009, 2:31:23 AM11/16/09
to
> esos...@ieee-dot-org.invalid

Thanks a lot, Eric!

Luca

0 new messages