Re: [PATCH] C undefined behavior fix

From: Momchil Velikov (
Date: Thu Jan 03 2002 - 11:48:56 EST

>>>>> "Edgar" == Edgar Toernig <> writes:

Edgar> David Woodhouse wrote:
>> What part of 'undefined behaviour' is so difficult for people to understand?

Edgar> The behaviour is undefined by the C standard. But the mentioned
Edgar> pointer arithmetic is defined in the environment where it has been
Edgar> used. GCC tries to optimize undefined C-standard behaviour. And
Edgar> IMHO that's the point. It may optimize defined behaviour and should
Edgar> not touch things undefined by the standard.

How do you imagine that "not touch" ? like "#if 0 ... #endif" ?

Edgar> PS: Hey, we are talking about C, the de luxe assembler! *g*

Standard is a standard. Broken code is broken code. Sometimes you can
get away with it, sometimes you can't and when you can't you fix the
code. Or define your own standard and make a compiler implementing

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:21 EST