From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on ip-172-31-65-14.ec2.internal X-Spam-Level: X-Spam-Status: No, score=-3.2 required=3.0 tests=BAYES_00,NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 Path: eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Compiler error (2) ? Date: Mon, 26 Sep 2022 10:34:19 +0200 Organization: Adalog Message-ID: References: <7085edb5-688c-410c-b401-23ff3ca2a38fn@googlegroups.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Date: Mon, 26 Sep 2022 08:34:15 -0000 (UTC) Injection-Info: reader01.eternal-september.org; posting-host="e8a32e2defd05dbfb7071d879f1df9fc"; logging-data="3891618"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/Xf0VkYMgeNgGP+oRRFYJ2" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Cancel-Lock: sha1:uL0/I950yi0Cdk5XWNy5ZPTN6gQ= In-Reply-To: <7085edb5-688c-410c-b401-23ff3ca2a38fn@googlegroups.com> Content-Language: fr Xref: reader01.eternal-september.org comp.lang.ada:64415 List-Id: Please give the exact error message, and why you think it could be a compiler error. Otherwise, it's hard to help... Le 26/09/2022 à 08:54, reinert a écrit : > Hello, > > This must reveal a compiler error : > ------------------------------------------------------------------------------------------------------- > with Ada.Text_IO; > with Ada.Containers.Vectors; > procedure test1a is > type s_name_type is (s0, s1, s2, s3, s4, s5, s6, s7, s8, s9); > for s_name_type use > (S0 => 0, S1 => 1, S2 => 2, S3 => 3, S4 => 4, > S5 => 5, S6 => 6, S7 => 7, S8 => 8, S9 => 9); > package s_names_p is new Ada.Containers.Vectors > (Index_Type => Positive, Element_Type => s_name_type); > k : integer := 7; > > -- n : constant integer := 7; -- uncomment this line and comment out the line below. > n : constant integer := k; > > s_names: constant s_names_p.Vector := [for i in 3..n => S0]; > begin > Ada.Text_IO.Put_Line(s_names'Image); > end test1a; > ------------------------------------------------------------------------------------------------------- > (compiled using alire and > package Compiler is > for Switches ("ada") use ("-gnatwa", "-gnata", "-gnatX", "-gnatwv"); > end Compiler; > ------------------------------------------------------------------------------------------------------- > > Right? > > reinert -- J-P. Rosen Adalog 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52 https://www.adalog.fr