F
Flash Gordon
On Thu, 08 Jan 2004 21:00:37 GMT
The *only* reason code invokes undefined behaviour is because it does
something the standard says is undefined behaviour. It is nothing to do
with what compilers do when said undefined behaviour is invoked.
Knowing what any given set of compilers and options does with undefined
behaviour does not tell you anything about undefined behaviour. It does
not even tel you why the behaviour was originally specified as
undefined since those choices where made before any compiler you are
likely to use was written.
Do you have to see someone killed by having mains electricity connected
across their heart before you believe it is a bad idea? Do you have to
write off your computer before agreeing that connecting the power supply
to the motherboard incorrectly (something which *was* possible with AT
PSUs)?
As I said above, I don't want to write crap code with those tricks in
it. I stick to the standard when writing code, or at least I try to
I want to write the best code I can, and be aware of *why* that kind
of code results in undefined behavior.
The *only* reason code invokes undefined behaviour is because it does
something the standard says is undefined behaviour. It is nothing to do
with what compilers do when said undefined behaviour is invoked.
This is *understanding*. The
other way is just *believing*, and that could lead to mistakes too.
Knowing what any given set of compilers and options does with undefined
behaviour does not tell you anything about undefined behaviour. It does
not even tel you why the behaviour was originally specified as
undefined since those choices where made before any compiler you are
likely to use was written.
Do you have to see someone killed by having mains electricity connected
across their heart before you believe it is a bad idea? Do you have to
write off your computer before agreeing that connecting the power supply
to the motherboard incorrectly (something which *was* possible with AT
PSUs)?