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-Thread: 103376,b0a828f417615ded X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder3.cambrium.nl!feeder1.cambrium.nl!feed.tweaknews.nl!amsnews11.chello.com!nuzba.szn.dk!news.jacob-sparre.dk!pnx.dk!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Compiler Bug Date: Tue, 4 Dec 2007 16:45:30 -0600 Organization: Jacob's private Usenet server Message-ID: References: <9f4bc0eb-d44a-43f9-83bd-dd07fa8538f2@i12g2000prf.googlegroups.com> <8a6283ea-be44-46d7-a2f1-a6d626266b58@p69g2000hsa.googlegroups.com> <97d0825d-ee08-45ef-b736-ca005caf1a81@e23g2000prf.googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: jacob-sparre.dk 1196908821 16076 69.95.181.76 (6 Dec 2007 02:40:21 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 6 Dec 2007 02:40:21 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1914 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1914 Xref: g2news1.google.com comp.lang.ada:18736 Date: 2007-12-04T16:45:30-06:00 List-Id: "REH" wrote in message news:97d0825d-ee08-45ef-b736-ca005caf1a81@e23g2000prf.googlegroups.com... > No, I can't, sorry. But the gist of it is: > > function F1 return T1; > pragma Inline(F1); > > function F1 return T1 is > R : T1; > begin > -- do stuff > return R; > end F1; > > function F2 return T2 is > V : T1 := F1; > R : T2; > begin > -- do stuff > return R; > end F2; > > The compiler and debugger treat the R in F2 as if it is of type T1, > not T2. Exceeding the bounds of T1 cause F2 to raise a > constraint_error. The problem goes away if the pragma inline is > removed. The way you describe it, it sounds like a compiler bug. But without seeing the actual code, it is impossible to tell for sure. (It's not unusual for a compiler-bug-reporter to see one problem when something totally different is going on -- it even happens to me from time-to-time.) Ada's visibility rules are complex enough that you could be getting some other kind of conflict without realizing it. Randy.