Re: what is the output of this program?



Martin said:

On Fri, 30 May 2008 04:12:46 +0100, Keith Thompson <kst-u@xxxxxxx> wrote:
Sure, but there's undefined behavior and then there's undefined
behavior.

That seems to dilute somewhat the exhortations I read about undefined
behaviour being intolerable in all its manifestations. Now it seems there
is a continuum of undefined behaviours ranging from the tolerable (and
dare I say "acceptable") to the unacceptable. If not a continuum, then at
least split between tolerable and unacceptable.

Keith, have I read too much into your comment?

You may have read too much into the party line of clc polemic. Keith
rightly draws a distinction between code that exhibits undefined behaviour
because it uses a machine-specific tool/technique/function that is
necessary for the purposes of the program to be fulfilled, and code that
exhibits undefined behaviour because the programmer doesn't know spit
about C. (I trust that you will read that sentence in the spirit in which
it was intended, rather than take it /too/ literally.)

Writing code of the first kind is very sensible, but is merely off-topic in
comp.lang.c (which doesn't address platform specifics). Writing code of
the second kind is simply wrong.

Telling the difference between the two is not something that many clcers
are particularly skilled at doing, but it is quite clear that Keith
understands the difference.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -http://www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
.



Relevant Pages

  • Re: alter table add column question
    ... Keith G Hicks wrote: ... > set up code in batches and thoroughly test things before altering their ... > alter table Customer add column DogsNames c ... Are you writing code that relies on column positions? ...
    (microsoft.public.fox.programmer.exchange)
  • Improving Python (was: Lambda going out of fashion)
    ... Keith> or 2.4 is very good, has more features than most people will ever ... Keith> use, and they (Guido, et al.) can stop tinkering with it now and ... Note that there's more to be done than simply writing code. ...
    (comp.lang.python)

Loading