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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,fbf5a4926ca8ebfd X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!wn11feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!53ab2750!not-for-mail Newsgroups: comp.lang.ada From: anon@anon.org (anon) Subject: Compiles OK? Re: GNAT quirk Reply-To: anon@anon.org (anon) References: <1186143806.109608.153890@m37g2000prh.googlegroups.com> X-Newsreader: IBM NewsReader/2 2.0 Message-ID: Date: Fri, 03 Aug 2007 23:27:38 GMT NNTP-Posting-Host: 12.64.30.237 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1186183658 12.64.30.237 (Fri, 03 Aug 2007 23:27:38 GMT) NNTP-Posting-Date: Fri, 03 Aug 2007 23:27:38 GMT Organization: AT&T Worldnet Xref: g2news2.google.com comp.lang.ada:1359 Date: 2007-08-03T23:27:38+00:00 List-Id: 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 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 >