comp.lang.ada
 help / color / mirror / Atom feed
From: lutz@iks-jena.de (Lutz Donnerhacke)
Subject: Re: Does a null pointer always raise Constraint_Error?
Date: 13 Dec 2000 14:25:42 GMT
Date: 2000-12-13T14:25:42+00:00	[thread overview]
Message-ID: <slrn93f1ic.vo.lutz@taranis.iks-jena.de> (raw)
In-Reply-To: IeLZ5.7495$bw.651358@news.flash.net

* Ken Garlington wrote:
>"Lutz Donnerhacke" <lutz@iks-jena.de> 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



  reply	other threads:[~2000-12-13 14:25 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.10.10011301306120.793-100000@lexis.di.fct.unl.pt>
     [not found] ` <tgzoihpon4.fsf@mercury.rus.uni-stuttgart.de>
     [not found]   ` <9074fi$93b$1@nnrp1.deja.com>
     [not found]     ` <3A3253B1.AD8F32CF@ebox.tninet.se>
     [not found]       ` <90u1vi$uah$1@nnrp1.deja.com>
     [not found]         ` <90ukfm$c4p$1@nnrp1.deja.com>
2000-12-12 16:23           ` Does a null pointer always raise Constraint_Error? Wayne Magor
2000-12-12 20:27             ` Keith Thompson
2000-12-13  0:46               ` Robert Dewar
2000-12-13  8:58                 ` Lutz Donnerhacke
2000-12-13 13:56                   ` Ken Garlington
2000-12-13 14:25                     ` Lutz Donnerhacke [this message]
2000-12-13 14:58                       ` Florian Weimer
2000-12-13 15:17                         ` Lutz Donnerhacke
2000-12-13 15:40                         ` Robert Dewar
2000-12-13 20:07                           ` Florian Weimer
2000-12-14 13:08                             ` Robert Dewar
2000-12-14 14:29                               ` Ken Garlington
2000-12-15  1:45                                 ` Robert Dewar
2000-12-13 15:37                       ` Robert Dewar
2000-12-12 20:31             ` Keith Thompson
2000-12-13 19:58               ` Florian Weimer
2000-12-13  0:43             ` Robert Dewar
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox