On Wed, 25 Mar 2009, H.J. Lu wrote:
> gcc.c-torture/compile/pr16566-2.c has
>
> ---
> struct A
> {
> int i;
> int x[];
> };
>
> int foo(struct A a)
> {
> return (a,a).x[0];
> }
> ---
>
> foo will return a random number. I don't think it should be allowed.This is a perfectly ordinary case of accessing outside array bounds, undefined behavior at runtime if the code in question is ever executed but OK in a program as long as the dereference isn't executed. -- Joseph S. Myers [email protected]
