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,a0d43ac4516d0597,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-02 06:58:56 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: volkert@nivoba.de (Volkert) Newsgroups: comp.lang.ada Subject: Misleading Compiler Warning Date: 2 Feb 2003 06:58:56 -0800 Organization: http://groups.google.com/ Message-ID: NNTP-Posting-Host: 213.144.136.158 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1044197936 12718 127.0.0.1 (2 Feb 2003 14:58:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 2 Feb 2003 14:58:56 GMT Xref: archiver1.google.com comp.lang.ada:33696 Date: 2003-02-02T14:58:56+00:00 List-Id: The snippet is reproduced from a large application we currenty bringing from DEC Ada 83 to GNAT (OpenVMS).... the GNAT 3.16w gives a Compiler-Warning whereas the DEC Compiler keeps silent. % gnat make wmain.adc gcc -c -x ada wmain.adc gcc -c -x ada pack.adc pack.adc:9:03: warning: in instantiation at Gen.adc:4 pack.adc:9:03: warning: value not in range of type "Standard.Integer" pack.adc:9:03: warning: "Constraint_Error" will be raised at run time gnatbind -x wmain.ali gnatlink wmain.ali The example runs on both compilers without raising a Constraint_Error. Is it just a misleading warning message ... if so, i send a bug-report to act. Volkert PS: ObjectAda 7.2.1 compiles also with no warnings ---- with Pack; procedure WMain is type T is range 0 .. 100; package P is new Pack(T=>T); begin P.Do_It; end; ---- generic type T is range <>; package Pack is procedure Do_It; end Pack; ---- with Gen; package body Pack is package My_Gen is new Gen(s => Float); package Inner_Gen_My_Gen is new My_Gen.Inner_Gen(T => T); procedure Do_It is begin Inner_Gen_My_Gen.Do_It; end; end Pack; --- generic type S is private; package Gen is generic type T is range <>; package Inner_Gen is procedure Do_It; end Inner_Gen; end Gen; --- package body Gen is package body Inner_Gen is type B is array(T) of Boolean; pragma Pack(B); type C is array (0 .. 100) of B; procedure Do_It is O : C; begin O(1)(0) := False; end; end; end Gen; ---- gnat.adc pragma Source_File_Name ( Spec_File_Name => "*_.adc", Casing => MixedCase, Dot_Replacement => "__"); pragma Source_File_Name ( Body_File_Name => "*.adc", Casing => MixedCase, Dot_Replacement => "__");