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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,5095dad989e89e23 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2000-12-13 06:27:22 PST Path: supernews.google.com!sn-xit-02!supernews.com!isdnet!195.27.83.146.MISMATCH!news-FFM2.ecrc.net!news.iks-jena.de!lutz From: lutz@iks-jena.de (Lutz Donnerhacke) Newsgroups: comp.lang.ada Subject: Re: Does a null pointer always raise Constraint_Error? Date: 13 Dec 2000 14:25:42 GMT Organization: IKS GmbH Jena Distribution: world Message-ID: References: <9074fi$93b$1@nnrp1.deja.com> <3A3253B1.AD8F32CF@ebox.tninet.se> <90u1vi$uah$1@nnrp1.deja.com> <90ukfm$c4p$1@nnrp1.deja.com> <3A36511D.973D82BD@nowhere.com> <916gsr$e6e$1@nnrp1.deja.com> NNTP-Posting-Host: taranis.iks-jena.de Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: slrn/0.9.5.7 (UNIX) Xref: supernews.google.com comp.lang.ada:3057 Date: 2000-12-13T14:25:42+00:00 List-Id: * Ken Garlington wrote: >"Lutz Donnerhacke" wrote in message >: * Robert Dewar wrote: >: [access to empty arrays represent as Null (System.Address)] >: > subtype n is string (1 .. 0); >: > type np is access n; >: > a, b : np; >: > >: > if a.all = b.all then ... >: > >: >it is a common compiler bug to translate this as >: > >: > for j in n'range loop >: > if a.all (j) = b.all (j) .... >: > >: >and the null loop causes no checks to be made :-) >: >: I do not see the bug. > >Probably explains why it's so common... > >(I'm guessing it might have something to do with the case where a or b are >null. Presumably, no exception would be raised if the compiler generated >this kind of code, due to n'range causing the body of the loop to be >skipped altogether?) Possible, but irrelevant IMHO. Two empty arrays of the same component type are equal per definition. -- http://www.tm.oneiros.de/calendar/2001/index.html