From -8875336299233178747
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,6d203f57726a4ad8
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2003-01-11 19:02:54 PST
Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!kibo.news.demon.net!mutlu.news.demon.net!demon!mail2news.demon.co.uk!devnull
From: nagle@animats.com (John Nagle)
Newsgroups: comp.std.c++
Subject: Re: Intelligent subscript checking
Date: Sun, 12 Jan 2003 03:02:47 +0000 (UTC)
Organization: Prodigy Internet http://www.prodigy.com
Lines: 41
Approved: fjh@cs.mu.oz.au (Fergus Henderson , moderator of comp.std.c++)
Message-ID: <3E20DB45.3090806@animats.com>
References: <a6150b7f.0212140326.45196cf4@posting.google.com> <3E081F9B.3090409@nycap.rr.com> <d6651fb6.0212300235.6f30cea2@posting.google.com> <fCDW22S7qKE+EwDj@robinton.demon.co.uk> <d6651fb6.0301020346.45b60a60@posting.google.com> <avdrc8$qf2$1@glue.ucr.edu> <26fabedc.0301080212.14b8d54e@posting.google.com> <3E1C87E8.70409@animats.com> <d6651fb6.0301090257.513ebec@posting.google.com> <3E1DEFAF.4020805@animats.com> <avls6r$ssl$1@glue.ucr.edu>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: mail2news.demon.co.uk 1042340567 26802 10.0.0.1 (12 Jan 2003 03:02:47 GMT)
X-Complaints-To: abuse@demon.net
NNTP-Posting-Date: Sun, 12 Jan 2003 03:02:47 +0000 (UTC)
X-Received: from mulga.cs.mu.oz.au ([128.250.1.22])
	by news.demon.co.uk with esmtp (Exim 4.05)
	id 18XYOa-0006y9-00
	for mail2news@news.news.demon.net; Sun, 12 Jan 2003 03:02:45 +0000
X-Received: from localhost (localhost [[UNIX: localhost]]) by mulga.cs.mu.OZ.AU
	id OAA02125; Sun, 12 Jan 2003 14:02:34 +1100 (EST)
X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f
X-Path: comp-std-cpp-robomod!not-for-mail
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Delivered-To: std-c++@ncar.ucar.edu
X-User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.4) Gecko/20011128 Netscape6/6.2.1
X-Accept-Language: en-us
X-Newsgroups: comp.std.c++
X-NNTP-Posting-Date: Sat, 11 Jan 2003 22:00:19 EST
X-UserInfo1: T[OQBYCDXJV[S_H]^JKBOW@@YJ_ZTB\MV@BJ]Q]KEYUNDQUCCNSUAACY@L[ZX__HGFD]JBJNSFXTOOGA_VWY^_HG@FW_HUTHOH]TBPGCO\P^PLP^@[GLHUK@WLECKFVL^TYG[@RMWQXIWM[SDDYWNLG_G[_BWUCHFY_Y@AS@Q[B\APPF@DCZM_PG_VSCPQZM
X-MailScanner: PASSED (v1.2.7 54216 h0C30KR5054814 mailbox3.ucsd.edu)
X-Spam-Status: No, hits=-9.5 required=5.0
	tests=EMAIL_ATTRIBUTION,NOSPAM_INC,QUOTED_EMAIL_TEXT,REFERENCES,
	      SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_MOZILLA_UA,
	      X_ACCEPT_LANG
	version=2.41
Xref: archiver1.google.com comp.std.c++:17038

thp@cs.ucr.edu wrote:


> There have been threads here and/or in comp.std.c where members of the
> Standards committee(s) seemed to agree and to argue convincingly that,
> as soon as undefined behavior becomes proveably inevitable, the
> behavior becomes undefined.  


     As someone else pointed out, the presence of an
"assert" may make an ill-formed program correct, because
the assert causes the program to terminate in a defined way.
Thus, in a strict, rather legalistic sense, the compiler
can't hoist the assert.

     Arguably, there needs to be some assert-like built-in used
for checking that the compiler understands to indicate improper
behavior, and can thus can hoist.  But there must be agreement
on what it is.

     There is also the problem that any loop which contains
a floating point operation might, conceivably, be terminated
by a floating point overflow exception.   So if there's
an otherwise inevitable subscript error ahead, does the
compiler have to defer detecting it because the error
might be preempted by a floating point exception?

     Clearly, programs that get into these situations are
broken, and there's utility in detecting errors efficiently.
Perhaps a clarifying comment by the Committee is in order.
Thanks.

				John Nagle
				Animats

---
[ 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://www.jamesd.demon.co.uk/csc/faq.html                       ]



