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: 103376,12a7e74c384c0acb X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Received: by 10.68.222.225 with SMTP id qp1mr864013pbc.8.1348725614015; Wed, 26 Sep 2012 23:00:14 -0700 (PDT) Path: a8ni23580644pbd.1!nntp.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!post02.iad.highwinds-media.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail From: Stephen Leake Newsgroups: comp.lang.ada Subject: Re: optimization away of checks in 'valid References: <5a0711d8-81ad-4200-9b6e-a80feffd5302@googlegroups.com> Date: Thu, 27 Sep 2012 02:00:08 -0400 Message-ID: <85mx0catuf.fsf@stephe-leake.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.2 (windows-nt) Cancel-Lock: sha1:cRQ5XN6GHhIDMduQmn3usAeG0r8= MIME-Version: 1.0 X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: d678a5063eb6de029e66120580 X-Received-Bytes: 1697 Content-Type: text/plain Date: 2012-09-27T02:00:08-04:00 List-Id: Joseph Wisniewski writes: > Basically, the question is, if 'valid is called on an integer object, > are there conditions under which some of the checks done by 'valid > (range checking on an object of an integer subtype) are removed? See ARM 13.9.2; it lists the operations that can return invalid values. > Specifically, 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. Reading an input parameter is not in the list of operations that can return invalid values. "interfacing to another language" is on the list, which is what you are doing, but I suspect that really means "calling a subprogram implemented in another language"; ie, a subprogram with pragma Import. Do you have pragma Export on the Ada function? That would mean reading the input parameter _is_ interfacing to another language, and you could complain to your compiler vendor. -- -- Stephe