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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,19bd7ab0daefd69b X-Google-Attributes: gid103376,public From: Robert A Duff Subject: Re: Storage_Error with parameterized records Date: 1998/07/08 Message-ID: #1/1 X-Deja-AN: 369427839 Sender: bobduff@world.std.com (Robert A Duff) References: <359D3A0C.13AF4C53@cl.cam.ac.uk> <6nntf2$u2m$1@nnrp1.dejanews.com> Organization: The World Public Access UNIX, Brookline, MA Newsgroups: comp.lang.ada Date: 1998-07-08T00:00:00+00:00 List-Id: david.c.hoos.sr@ada95.com writes: > In article <359D3A0C.13AF4C53@cl.cam.ac.uk>, > Markus Kuhn wrote: > > type Correlation_Matrix(Last_Line : Natural := 0) is > > record > > Mat : CMatrix(0 .. Last_Line, 0 .. Last_Line); > > end record; > > > > causes the following warnings (and at runtime the promised > > Storage_Error): > > > > warning: Storage_Error will be raised at run-time > > warning: creation of object of this type may raise Storage_Error Perhaps a different wording of the message would make it clearer. The thing is, if you say "X: Correlation_Matrix(Last_Line => 1_000);" it will probably *not* raise Storage_Error. The point is that (1) if you don't constrain it, it will raise S_E, and (2) there's no point in giving a default value unless you want to have some unconstrained objects. If you leave out ":= 0", I would think the warning would go away. But of course you could still get S_E for "Last_Line => 1_000_000_000" on an object decl. - Bob -- Change robert to bob to get my real email address. Sorry.