From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,12a7e74c384c0acb X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.224.189.75 with SMTP id dd11mr144312qab.6.1348648524933; Wed, 26 Sep 2012 01:35:24 -0700 (PDT) Received: by 10.236.173.202 with SMTP id v50mr2619671yhl.19.1348648524902; Wed, 26 Sep 2012 01:35:24 -0700 (PDT) Path: e10ni53868478qan.0!nntp.google.com!l8no11162534qao.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Wed, 26 Sep 2012 01:35:24 -0700 (PDT) In-Reply-To: <5a0711d8-81ad-4200-9b6e-a80feffd5302@googlegroups.com> Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=153.98.68.197; posting-account=pcLQNgkAAAD9TrXkhkIgiY6-MDtJjIlC NNTP-Posting-Host: 153.98.68.197 References: <5a0711d8-81ad-4200-9b6e-a80feffd5302@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: optimization away of checks in 'valid From: Ludovic Brenta Injection-Date: Wed, 26 Sep 2012 08:35:24 +0000 Content-Type: text/plain; charset=ISO-8859-1 Date: 2012-09-26T01:35:24-07:00 List-Id: Joseph Wisniewski wrote on comp.lang.ada: > we had a case where C++ code was not checking the bounds of a > integer subtype as it was passed to Ada code via a function > parameter. The Ada code _was_ checking via 'valid. 'valid returned > true even though the integer value was out of bounds. Turns out the > compiler relied on the "allowed assumption" that all callers "check > their bounds" for such data. I'd think this assumption should be disallowed for exported subprograms, or actually for all subprograms with a Convention other than Ada? -- Ludovic Brenta.