| Bjorn Reese 2007-05-19, 10:06 pm |
| Frank Cusack wrote:
> On Fri, 18 May 2007 16:26:54 -0700 Frank Cusack <fcusack@fcusack.com> wrote:
>
> ie, it doesn't even matter that you have to pass the type to va_arg(),
> since all pointer types (the pointer itself) are equivalent, and all
> can be compared to a null pointer (or null pointer constant?) for
> equality.
That is a good question. According to my reading of C99, char and float
are not compatible [6.2.7] even after default argument promotion, so
char * and float * are not compatible either [6.7.5.1/2, 6.2.5/27].
Getting an incompatible pointer with va_arg() invokes undefined behavior
[6.5.2.2/6].
Another way to look at it is that void * and char * are required to have
the same representation and alignment, but char * and float * are not
[6.2.5/17].
--
mail1dotstofanetdotdk
|