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 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-02 22:04:18 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!postnews1.google.com!not-for-mail From: volkert@nivoba.de (Volkert) Newsgroups: comp.lang.ada Subject: Re: Misleading Compiler Warning Date: 2 Feb 2003 22:04:18 -0800 Organization: http://groups.google.com/ Message-ID: References: <3E3D6BDC.1010501@acm.org> NNTP-Posting-Host: 138.189.120.38 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1044252258 19857 127.0.0.1 (3 Feb 2003 06:04:18 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 3 Feb 2003 06:04:18 GMT Xref: archiver1.google.com comp.lang.ada:33706 Date: 2003-02-03T06:04:18+00:00 List-Id: > > > > 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; > > ^ Here you assume that 0 is a value of the formal type T > > > end; > > > > end; > > > > end Gen; > > There is no guarantee that zero is a value of the actual type used for > the formal type T; a (sub)type with a 'First of one is very likely. > While the warning you got is not very good, some sort of warning seems > in order here. This line was only for testing. Remove it and you will get the same gnat warning. With regards Volkert