Re: The annotated annotated annotated C standard part 3





"Clive D. W. Feather" wrote:

In article <aM-dnZzsy5HFZw7anZ2dnUVZ8tGqnZ2d@xxxxxx>, Richard Heathfield
<rjh@xxxxxxxxxxxxxxx> writes
Your writings have created a set of mis-usages and errors in their
turn. For example, we have people raving here that "sequence points
are compilers 101" when in fact they aren't,

If that term means what I think it is then, no, they aren't something
that a beginner compiler-writer might think of.

Here, I think I'd have to agree to differ. They seem to me to be a
perfectly natural way of thinking about compilation.

I'm happy to differ. I'd agree that there's a need to think about things
like "when do I need to flush registers?", but I think the C Standard
took this to a new stage beyond existing language documents.

There are several things at play. Sequence points in the C standard
identified one of the major issues of side-effect and parallel execution.
When you have two assignments to the same variable between
sequence points there are potentially undefined results. The C language
support for auto increment found in the PDP-11 and now many other
processors was an early taste of things to come for processors with
multiple execution streams. It is a testament to C that it can map
effectively onto some diverse architectures.

C was correct in not trying to force compilers to detect multiple writes
between sequence points. I think it was Richard who wrote a small
example whose detection would have been difficult in a compiler.

C is an implementation language, writing ambiguous statements should
produce undefined results. Craftsmen who use the language should
be clear in how they use the language.


Regards

--
Walter Banks
Byte Craft Limited
Tel. (519) 888-6911
Fax (519) 746 6751
http://www.bytecraft.com
walter@xxxxxxxxxxxxx


.



Relevant Pages

  • Re: Warning: The structure contains misaligned fields
    ... end module test ... If you read he words it says WARNing. ... You have specified SEQUENCE ... Some compilers have options to hide the warning ...
    (comp.lang.fortran)
  • Re: Same code and different result, Why?
    ... No, it is undefined for all other compilers, as well. ... of sequence point is common for all C/C++ compilers. ... for the course for the technology you are using right now, ... sometimes decided by the underlying hardware, ...
    (microsoft.public.vc.language)
  • Re: Same code and different result, Why?
    ... But the whole point is that the language offers two distinct ways ... No, it is undefined for all other compilers, as well. ... of sequence point is common for all C/C++ compilers. ... exact place where sequence point occurs may vary from vendor to ...
    (microsoft.public.vc.language)
  • Re: To Richard Heathfield from spinoza1111
    ... and making a mess of it because you lacked the intellectual ... integrity to stand up to commercial pressure Herb ... Explaining why two writes to the same variable between sequence ... actually happens in most C compilers is undefined. ...
    (comp.programming)
  • Re: Paul Grahams Arc is released today... what is the long term impact?
    ... It's not a matter of characters it is a ... What makes you think that language is not intimately related to history? ... programming in machine code? ... allows for treating a sequence of words as a single unit and yet somehow ...
    (comp.lang.lisp)