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=0.4 required=5.0 tests=BAYES_00,FORGED_MUA_MOZILLA autolearn=no 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.66.81.98 with SMTP id z2mr1183812pax.19.1349312550793; Wed, 03 Oct 2012 18:02:30 -0700 (PDT) Path: t10ni23610462pbh.0!nntp.google.com!border1.nntp.dca.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!novia!news-hub.siol.net!news.mi.ras.ru!goblin-spool!goblin2!goblin.stu.neva.ru!news.neu.edu.cn!newsgate.cuhk.edu.hk!news.netfront.net!not-for-mail From: Jeffrey Carter Newsgroups: comp.lang.ada Subject: Re: optimization away of checks in 'valid Date: Wed, 26 Sep 2012 09:46:42 -0700 Organization: Also freenews.netfront.net; news.tornevall.net Message-ID: References: <5a0711d8-81ad-4200-9b6e-a80feffd5302@googlegroups.com> NNTP-Posting-Host: 184.20.60.112 Mime-Version: 1.0 X-Trace: adenine.netfront.net 1348678004 81979 184.20.60.112 (26 Sep 2012 16:46:44 GMT) X-Complaints-To: news@netfront.net NNTP-Posting-Date: Wed, 26 Sep 2012 16:46:44 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120827 Thunderbird/15.0 In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Date: 2012-09-26T09:46:42-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. Using any scalar subtype other than those in Interfaces.C when interfacing to C/++ is asking for trouble. -- Jeff Carter "Sons of a silly person." Monty Python & the Holy Grail 02 --- news://freenews.netfront.net/ - complaints: news@netfront.net ---