Re: curl_easy_setopt and typeof
Date: Mon, 14 Apr 2008 00:37:53 -0400
--On Sunday, April 13, 2008 5:45 PM -0700 Dan Fandrich
> On Sun, Apr 13, 2008 at 01:42:08PM -0400, Nathan E. Moore wrote:
>> Section 220.127.116.11 The va_arg macro (also available at
>> The parameter type shall be a type name specified such that the type of
>> a pointer to an
>> object that has the specified type can be obtained simply by postfixing
>> a * to type. If
>> there is no actual next argument, or if type is not compatible with the
>> type of the
>> actual next argument (as promoted according to the default argument
>> promotions), the
>> behavior is undefined, except for the following cases:
>> â€” one type is a signed integer type, the other type is the
>> corresponding unsigned integer
>> type, and the value is representable in both types;
>> â€” one type is pointer to void and the other is a pointer to a
>> character type.
>> I guess the way I read it says that you do get argument promotion. I
>> would assume the
>> promotion would be done prior to pushing the arguments onto the stack.
>> But I have been
>> wrong before and likely will be again.
> There is now way the compiler would know the expected type at the time of
> calling in order to do the promotion. The behaviour in this case is, as
> documented, undefined.
Indeed there is no way for the compiler to know that information short of
halting problem, but that is not what I meant. I meant that floats are all
doubles, smaller integral types to long/unsigned long, before the function
call is made.
This interpretation matches what the specs for printf say about the length
Received on 2008-04-14