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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,8963682ce4cab241 X-Google-Attributes: gid103376,public From: wanker@exploited.barmy.army Subject: Re: GNAT Limitations? Date: 1998/01/25 Message-ID: <6aft7v$vos$1@Masala.CC.UH.EDU>#1/1 X-Deja-AN: 319143696 References: <6aesm3$sr6$1@Masala.CC.UH.EDU> <01bd296e$fad757c0$0e2915c0@p5120> Originator: punkrock@pegasus Organization: The Exploited Barmy Army Newsgroups: comp.lang.ada Date: 1998-01-25T00:00:00+00:00 List-Id: In article <01bd296e$fad757c0$0e2915c0@p5120>, bklungle wrote: >1. Read the manual Did that. >2. Remove Ada. The manual told me to use Ada. So should I do (1) then ignore what it says? After all I can't heed 1 & 2 at the same time. If the LRM says one thing and GNAT is supposed to be a conforming Ada compiler, then it is a natural assumption to think that it would follow the Manual (or have the rules for reading manuals changed?). >3. Put the (n) where it belongs > In that case, the C/C++ to Ada document is in error. I will see about contacting the author/maintainer. >enclosed > >with Unchecked_Deallocation; Completely different from every manual I've seen, so reading the manual is of zero help here. > >procedure Huh is > > type x is > record > a : integer := 0; > b : integer := 0; > c : integer := 0; > end record; > type x_ptr is access x; > > procedure dispose is new Unchecked_Deallocation(x, x_ptr); Ok, so far so good. I'll try this out. > > an_x : x := (a => 1, b => 2, c => 3); This was already working, the problem was that leaving out the b caused it to not compile, and according to the manuals that you insisted I read, it should not do that. > > type m is array(1..2, 1..3) of integer; > an_m : m := (others => (others => 0)); > >begin > for i in an_m'range(1) loop > for j in an_m'range(2) loop > an_m(i,j) := i; > end loop; > end loop; >end Huh; > Ok, I see what you mean. > >-- and then compile > >linux:~/atest> touch *.adb >linux:~/atest> ada huh.adb >gcc -c -g huh.adb >gnatbind -x huh.ali >gnatlink -g huh.ali >linux:~/atest> Thank heaven for IDEs. Thank you for all your help, although I am still annoyed at the discrepencies between the Manuals & GNAT's behavior. But then it is a free tool, and even with the discrepencies it is probably one of the better quality compilers out there.