M
Michael Foukarakis
On 02/02/2010 11:15,spinoza1111wrote:
[snip]
A sensible "C standard" would have in fact defined a new C free of
these problems:
...
reaching the end of a non-void function without finding a return
statement, when the return value is used
But "reaching the end of a non-void function" and falling off the end
of the world is flat-earth thinking, the unnecessary preservation of
the mistakes of the past and the limitations of old machines. You
should have FORCED vendors to hire compiler developers to FIX this
problem by simply adding a machine language return statement behind
ALL such functions as a guard, or behind functions where the return is
missing. This isn't rocket science.
You've missed the point here, Baldrick. It's not that the function won't
return, but that because execution reaches the end of the function
without encountering a "return x" statement, the value that the function
returns is undefined. This is obviously a problem if the caller expects
to use the returned value.
And "undefined" simply means that the value seen by the caller will be
implementation-defined and therefore could be anything. I add this as
you don't appear to understand this simple point.To say it's "implementation defined" and to claim this is a standard
is bullshit. If it's "implementation defined" then it's not a
standard.
Well done for sidestepping the major flaw that I pointed out, and
focussing on the second point.
"International standard for dildoes"! "Anything you like including
exploding ones!"That is: standardization is for the safety and convenience of the
consumer/user, not for compiler vendors. Underwriter's Laboratories
certifies electrical products as safe, it does NOT say that "the
result is undefined", ...
Safe when used as directed. UL will doubtless specify the voltage range,
temperature range, humidity, and so on. To go outside these limits is
potentially *unsafe* and what actually happens is undefined. Get the
point now?
Even on the off-chance a troll does, it won't admit it.