Re: [PATCH] C undefined behavior fix

From: jtv (
Date: Thu Jan 03 2002 - 12:13:51 EST

On Thu, Jan 03, 2002 at 04:46:11PM +0100, Edgar Toernig wrote:
> The behaviour is undefined by the C standard. But the mentioned
> pointer arithmetic is defined in the environment where it has been
> used. GCC tries to optimize undefined C-standard behaviour. And
> IMHO that's the point. It may optimize defined behaviour and should
> not touch things undefined by the standard.

Ah, if only things were that easy! The whole reason the rules are as they
are in C is that it is not generally decidable whether or not the code
falls within those rules. Removing the assumptions we're talking about
from the rules would make the ability to optimize code an exception instead
of the rule.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Jan 07 2002 - 21:00:22 EST