[Bug middle-end/24434] [4.3/4.4/4.5/4.6 Regression] get_varargs_alias_set returns 0 always

segher at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Sat Jul 17 19:04:00 GMT 2010



------- 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



More information about the Gcc-bugs mailing list