lkml.org 
[lkml]   [2002]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] C undefined behavior fix
From
Date
>>>>> "Edgar" == Edgar Toernig <froese@gmx.de> 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
it.

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

\
 
 \ /
  Last update: 2005-03-22 13:15    [W:0.097 / U:0.224 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site