Path: csiph.com!xmission!news.snarked.org!border2.nntp.dca1.giganews.com!nntp.giganews.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: Gene Wirchenko Newsgroups: comp.compilers Subject: Re: Optimization techniques and undefined behavior Date: Sat, 11 May 2019 22:25:04 -0700 Organization: A noiseless patient Spider Lines: 25 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <19-05-080@comp.compilers> References: <19-04-021@comp.compilers> <19-04-023@comp.compilers> <19-04-037@comp.compilers> <19-04-039@comp.compilers> <19-04-042@comp.compilers> <19-04-044@comp.compilers> <19-04-047@comp.compilers> <19-05-004@comp.compilers> <19-05-006@comp.compilers> <19-05-016@comp.compilers> <19-05-017@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="22625"; mail-complaints-to="abuse@iecc.com" Keywords: design, comment Posted-Date: 12 May 2019 12:38:28 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com Xref: csiph.com comp.compilers:2315 On Fri, 3 May 2019 10:52:27 +0100, Martin Ward wrote: >On 03/05/19 00:48, Bart wrote: >> And I think that if a program can >> go seriously wrong through unchecked input, then that's a failure in >> proper validation. It's rather sloppy to rely on a runtime check put >> their by a compiler. > >The car analogy for C is that C is a car with no seatbelts, crumple >zones, roll bars, airbags etc. The car manual explicitly states that >nudging the kerb with any tyre is "undefined behaviour" and could >cause the car to explode in a fireball, killing all the passengers. Not quite. The manual would end with "undefined behaviour". Someone bringing up the possibility of a fireball explosion or nasal demons or whatever would be told that that is merely a quality of implementation issue. [snip] Sincerely, Gene Wirchenko [We're getting a bit far from compilers here. -John]