[PATCH] C undefined behavior fix
Joe Buck
jbuck@synopsys.COM
Fri Jan 4 17:22:00 GMT 2002
> You say I am being pedantic, but it is Linus (and perhgaps you) that are
> trying to argue from the standard. If you argue from the standard, you
> MUST be pedantic, which in this context means following the wording of
> the standard precisely.
The standard defines "implementation defined" to mean that the
implementation will document the definition. We have done so, in
extend.texi in the CVS tree. The only problem is that the definition we
propose is internally inconsistent. This means that the extend.texi
definition has a problem.
> No, it is not nonsense, the paragraph that you reject (I won't quote it
> again) is PART of the definition, it is just as valid a part of the definition
> as the statement about preserving bits. You want to pick and choose here and
> reject the part of the definition you don't like, but you have no basis in
> the standard, or for that matter elsewhere for doing this selection.
To fix an inconsistent definition you have to decide which part is
inconsistent. We could possibly fix the inconsistency by merely saying
that the result of *dereferencing* the pointer that is produced by I2P
and P2I and other operations is assumed not to alias with any object
other than the original pointed-to object, so that we don't cripple
aliasing. This may achieve most of what Richard wanted to achieve.
More information about the Gcc
mailing list