Path: csiph.com!goblin3!goblin.stu.neva.ru!news.misty.com!news.iecc.com!.POSTED.news.iecc.com!nerds-end From: "Derek M. Jones" Newsgroups: comp.compilers Subject: Re: Bounds checking, Optimization techniques and undefined behavior Date: Wed, 8 May 2019 19:08:33 +0100 Organization: virginmedia.com Lines: 17 Sender: news@iecc.com Approved: comp.compilers@iecc.com Message-ID: <19-05-069@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-020@comp.compilers> <19-05-024@comp.compilers> <19-05-025@comp.compilers> <19-05-028@comp.compilers> <19-05-029@comp.compilers> <19-05-034@comp.compilers> <19-05-045@comp.compilers> <19-05-057@comp.compilers> <19-05-060@comp.compilers> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: gal.iecc.com; posting-host="news.iecc.com:2001:470:1f07:1126:0:676f:7373:6970"; logging-data="4527"; mail-complaints-to="abuse@iecc.com" Keywords: tools Posted-Date: 08 May 2019 15:11:08 EDT X-submission-address: compilers@iecc.com X-moderator-address: compilers-request@iecc.com X-FAQ-and-archives: http://compilers.iecc.com In-Reply-To: <19-05-060@comp.compilers> Content-Language: en-US Xref: csiph.com comp.compilers:2304 David, > In C, what I coded was buggy - it has no defined behaviour. What /I/ > want the compiler to do, is warn me about it. (gcc doesn't, at least > not with the flags I tried. Maybe next version will - I always hope for > better warnings.) And I want the compiler to assume that I am not You might like to give Cerberus a go: http://cerberus.cl.cam.ac.uk/cerberus To cover all cases, click Options and untick Sequentialise operations (soon to be the default, I'm told). -- Derek M. Jones blog:shape-of-code.coding-guidelines.com