comp.lang.ada
 help / color / mirror / Atom feed
From: volkert@nivoba.de (Volkert)
Subject: Re: Misleading Compiler Warning
Date: 2 Feb 2003 22:04:18 -0800
Date: 2003-02-03T06:04:18+00:00	[thread overview]
Message-ID: <d37844cb.0302022204.2f0ef672@posting.google.com> (raw)
In-Reply-To: 3E3D6BDC.1010501@acm.org

> >    
> >    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



  reply	other threads:[~2003-02-03  6:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-02 14:58 Misleading Compiler Warning Volkert
2003-02-02 19:03 ` Jeffrey Carter
2003-02-03  6:04   ` Volkert [this message]
2003-02-03 16:54     ` Jeffrey Carter
2003-02-03  6:45 ` Simon Wright
2003-02-09  3:14   ` Robert I. Eachus
2003-02-09 15:31     ` Volkert
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox