From -8229626695203871519
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,7522e5259f7267d6
X-Google-Attributes: gidf78e5,public
From: Tom Payne <thp@roam-thp2.cs.ucr.edu>
Subject: Re: x = y = z;  Undefined?
Date: 2000/01/13
Message-ID: <85j22p$87k$1@pravda.ucr.edu>#1/1
X-Deja-AN: 571906653
X-Nntp-Posting-Host: roam-thp2.cs.ucr.edu
Approved: stephen.clamage@sun.com (comp.std.c++)
References: <MPG.12ddaa92533ae9679896a6@news.supernews.com> <t7so0bqea7.fsf@calumny.jyacc.com> <3876254a.30903561@news.csrlink.net> <derobert-9FC87E.01591309012000@news.erols.com> <3879ca08.3142429@news.csrlink.net> <derobert-8223E1.23372510012000@news.erols.com> <387b3c32.7816532@news.csrlink.net> <387B6338.FCE9D984@sensor.com> <387bb7c0.39451037@news.csrlink.net>
X-UID: 0000000001
X-Status: $$$T
Organization: University of California, Riverside
User-Agent: tin/pre-1.4-19990216 ("Styrofoam") (UNIX) (Linux/2.2.8 (i686))
Newsgroups: comp.std.c++
Originator: clamage@taumet


John Potter <jpotter@falcon.lhup.edu> wrote:

> Results may be retained where ever until a sequence point at which
> time the values must be stored.  

AFIK, only volatiles must be updated at the sequence point.

> You completely missed the point.  Read again.  Any compiler which
> decides to detect the presence of undefined code BETTER generate
                                                   ^^^^^^
> a diagnostic about its detection and not generate malicious code
> intended to do damage.

... at the peril of not being used but not in order to conform.

> The standard does not require the detection of undefined behavior
> to allow generation of reasonable optimized code.  It does not
> grant the right to commit crimes against society when it detects
> undefined behavior.

Undefined behavior breaks the contract between programmer and
conforming implementation.

> I rejected the reversal of instructions because it could only be
> done in the presence of undefined code.  The optimizer which did
> that must also be capable of nasal daemons.  No interest in
> fairy tales.

> Compiler writers are too busy trying to support the standard and
> provide reasonable optimization to have time for the nonsense
> suggested.

Accessing dangling reference can put bits to registers that send
voltages to actuators on devices that launch missles.  Evil 
consequences of undefined behavior do not necessarily involve
evil intent on the part of implementors.

Tom Payne


[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://reality.sgi.com/austern_mti/std-c++/faq.html              ]




