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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!gegeweb.org!news.ecp.fr!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Possible bug? Date: Fri, 10 Jul 2015 17:33:15 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1436567596 15039 24.196.82.226 (10 Jul 2015 22:33:16 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 10 Jul 2015 22:33:16 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.6157 Xref: news.eternal-september.org comp.lang.ada:26756 Date: 2015-07-10T17:33:15-05:00 List-Id: "J-P. Rosen" wrote in message news:mno5d2$s8e$1@dont-email.me... > Le 10/07/2015 11:46, Anatoly Chernyshev a écrit : ... >> Even though it should abort the compilation with an error message. >> No? >> > No. What happens is that it constructs an initialization aggregate whose > bounds are (n_d, 2), and then raises Constraint_Error because the bounds > of the initial value do not match those of the variable. That's exactly > what the warning is telling you. Right. More generally, "out of range" errors are always reported at runtime; compilers often give a warning but they're not allowed to reject the program. That's because perfectly sensible programs might contain an "out of range" error in code that will never be executed, and one would be very annoyed if the program was rejected. Consider: procedure Something (Mem : in Integer) is Size : constant := 0; begin if Size /= 0 then ... Mem / Size ... else ... end if; end Something; If dividing by zero was a compile-time error, it wouldn't be possible to divide by a constant whose value might be zero, even in code that's protected by a pre-test. (Imagine that Size started out as 1 and then later got changed to 0 during program maintenance.) That would be very annoying. The same is true for aggregates, since they can be sized by constants. Randy.