[PATCH] C undefined behavior fix
Linus Torvalds
torvalds@transmeta.com
Sat Jan 5 10:41:00 GMT 2002
On Sat, 5 Jan 2002, Florian Weimer wrote:
>
> The programmer didn't lay out "a" and "b" consecutively in memory, at
> least if the above code is from a C program.
In Richards example he did, by selecting sections etc for them.
> > - the C language clearly _does_ have different rules for pointer
> > arithmetic and for "integer arithmetic with cast pointers" (the first
> > one ends up being undefined and allows more aggressive optimization,
> > while the second one is implementation-defined and thus tends to
> > disallow some of those optimizations).
>
> Repeating this over and over again doesn't make it true.
Yeah yeah, too bad you can't read.
Linus
More information about the Gcc
mailing list