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,60c8b2ba217a0a9d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!postnews.google.com!f16g2000cwb.googlegroups.com!not-for-mail From: "Adam Beneschan" Newsgroups: comp.lang.ada Subject: Re: gnade error Date: 14 Nov 2006 09:52:51 -0800 Organization: http://groups.google.com Message-ID: <1163526771.847437.58180@f16g2000cwb.googlegroups.com> References: NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Trace: posting.google.com 1163526777 25554 127.0.0.1 (14 Nov 2006 17:52:57 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 14 Nov 2006 17:52:57 +0000 (UTC) User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.7.12) Gecko/20050922 Fedora/1.7.12-1.3.1,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: f16g2000cwb.googlegroups.com; posting-host=66.126.103.122; posting-account=cw1zeQwAAABOY2vF_g6V_9cdsyY_wV9w Xref: g2news2.google.com comp.lang.ada:7451 Date: 2006-11-14T09:52:51-08:00 List-Id: Jeffrey R. Carter wrote: > Stephen Leake wrote: > > Brian May writes: > > > >> gnu-db-sqlcli.adb:134:42: cannot inline "To_Ada" (call returns > >> unconstrained type) > > > > That seems clear to me. > > > > It's _legal_, but somewhere the code requests inlining of To_Ada, > > which GNAT can't do, for the reason stated. > > > > The fix is to remove the 'pragma Inline'. > > A pragma Inline should not cause a compilation error. The presence or > absence of a pragma should not change a legal program to an illegal > program nor illegal to legal. This really isn't true. First of all, many pragmas defined by the language have legality rules, and using a pragma that violates the legality rules makes your program illegal. As for Inline, there's a legality rule that the names listed need to be callable entities, plus there are rules about where Inline pragmas can be placed. Violating those rules will make your program illegal. The RM says that Inline is a recommendation that an implementation is free to ignore. Using an Inline that will get ignored will not make your program illegal according to the RM, but that is *not* the same as saying that it shouldn't cause a compilation error; there are plenty of reasons why users might want a compiler to reject a legal program, and using an ignored Inline might be one reason, especially if a warning message might get missed during a "make". Maybe one of the GNAT flags Brian used told it to reject pragmas it couldn't handle. I don't know GNAT very well so I can't say. Finally, the statement "The presence or absence of a pragma should not change a legal program to an illegal program nor illegal to legal" isn't true even for implementation-defined pragmas. 2.8(17) does say an implementation-defined pragma should not make an illegal program legal, but it also lists a couple exceptions to this rule. 2.8 also implies that a pragma that is not defined by the language nor by the implementation is ignored, but syntax rules still apply. However, if you use an implementation-defined pragma but violate the implementation-defined rules for that pragma, there's nothing I can see in 2.8 that says your program is still legal. That decision is left up to the implementation. -- Adam