comp.lang.ada
 help / color / mirror / Atom feed
From: anon@anon.org (anon)
Subject: Compiles OK? Re: GNAT quirk
Date: Fri, 03 Aug 2007 23:27:38 GMT
Date: 2007-08-03T23:27:38+00:00	[thread overview]
Message-ID: <KROsi.17499$ax1.5128@bgtnsc05-news.ops.worldnet.att.net> (raw)
In-Reply-To: 1186143806.109608.153890@m37g2000prh.googlegroups.com

Say What?  


Compiling: test5.adb (source file time stamp: 2007-08-02 18:36:46)

     1. procedure test5 is
     2. 
     3. procedure bad is
     4.     a : Long_Float := 3.0;
     5. begin
     6.     for i in 1 .. Integer(Long_Float'Truncation(a)) loop
     7.         null;
     8.     end loop;
     9. end bad;
    10. 
    11. procedure good is
    12. begin
    13.     for i in 1 .. Integer(Long_Float'Truncation(2.0)) loop
    14.         null;
    15.     end loop;
    16. end good;
    17. 
    18. 
    19. procedure gooder is
    20.     a    : Long_Float := 2.0;
    21.     idum : Integer;
    22. begin
    23.     idum := Integer(Long_Float'Truncation(a));
    24.     for i in 1 .. idum loop
    25.         null;
    26.     end loop;
    27. end gooder;
    28. 
    29. begin
    30.   null ;
    31. end ;

 31 lines: No errors


In <1186143806.109608.153890@m37g2000prh.googlegroups.com>,  Jerry <lanceboyle@qwest.net> writes:
>procedure bad is
>    a : Long_Float := 3.0;
>begin
>    for i in 1 .. Integer(Long_Float'Truncation(a)) loop
>        null;
>    end loop;
>end bad;
>
>bad.adb:4:37: unimplemented attribute
>gnatmake: "bad.adb" compilation error
>
>
>
>procedure good is
>begin
>    for i in 1 .. Integer(Long_Float'Truncation(2.0)) loop
>        null;
>    end loop;
>end good;
>
>Compiles OK.
>
>
>
>procedure gooder is
>    a    : Long_Float := 2.0;
>    idum : Integer;
>begin
>    idum := Integer(Long_Float'Truncation(a));
>    for i in 1 .. idum loop
>        null;
>    end loop;
>end gooder;
>
>Compiles OK.
>
>Jerry
>




  parent reply	other threads:[~2007-08-03 23:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-03 12:23 GNAT quirk Jerry
2007-08-03 20:05 ` Ludovic Brenta
2007-08-03 21:25   ` Jerry
2007-08-03 23:27 ` anon [this message]
2007-08-11  2:36 ` Nasser Abbasi
replies disabled

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