[PATCH] C undefined behavior fix

dewar@gnat.com dewar@gnat.com
Sat Jan 5 17:17:00 GMT 2002


>>No, you don't have that choice.

Well that's misinterpreting the formalism. You have to say what happens.

So for example, you could say

referencing a pointer constructed in xxx way has one of the following two
effects

a) referencing an object of the type at some arbitraqry address if the
machine code generated has the right alignment and address, see gcc code
for an exact definition of what machine code is generated.

b) causing an interrupt if the machine code generated has incorrect alignment
or address range.

See: precise definition, not undefined at all -- of course not very useful,
but please Linus, you will do SO much better wearing your pragmatic hat and
trying to define the semantics you want, and then let's discuss that!



More information about the Gcc mailing list