Re: Compatibility issue with 2.2.19pre7

From: Andrea Arcangeli (andrea@suse.de)
Date: Wed Jan 24 2001 - 04:02:40 EST


On Tue, Jan 23, 2001 at 11:51:15PM -0800, Richard Henderson wrote:
> On Thu, Jan 11, 2001 at 12:59:24AM +0100, Andrea Arcangeli wrote:
> > What I said is that I can write this C code:
> >
> > int x[2], * p = (int *) (((char *) &x)+1);
> > main()
> > {
> > *p = 0;
> > }
> >
> > This is legal C code.
>
> Err, no. This is not "legal" by any stretch of the imagination.
> This code has undefined behaviour.

I know this code has undefined behaviour at _runtime_. But I thought
you were obliged to allow it to compile. That was my only point.

> We aren't even obliged to allow this to compile.

I'd love if you could forbid it to compile.

Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Jan 31 2001 - 21:00:17 EST