------- Comment #13 from segher at gcc dot gnu dot org 2010-07-17 19:04 ------- (In reply to comment #12) > What does the standard say here? What is the type in effect for aliasing > when doing > > int i = va_arg (va, int); > > ? Is type-punning allowed when unpacking args?
>From C99, 7.15.1.1/2: [...] 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. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24434