comp.lang.ada
 help / color / mirror / Atom feed
From: "Adam Beneschan" <adam@irvine.com>
Subject: Re: gnade error
Date: 14 Nov 2006 09:52:51 -0800
Date: 2006-11-14T09:52:51-08:00	[thread overview]
Message-ID: <1163526771.847437.58180@f16g2000cwb.googlegroups.com> (raw)
In-Reply-To: vDm6h.1062516$084.547719@attbi_s22

Jeffrey R. Carter wrote:
> Stephen Leake wrote:
> > Brian May <bam@snoopy.apana.org.au> 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




  reply	other threads:[~2006-11-14 17:52 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14  8:08 gnade error Brian May
2006-11-14  9:20 ` Dmitry A. Kazakov
2006-11-14 13:42 ` Stephen Leake
2006-11-14 17:01   ` Jeffrey R. Carter
2006-11-14 17:52     ` Adam Beneschan [this message]
2006-11-15  1:23       ` Jeffrey R. Carter
2006-11-15 14:28         ` Robert A Duff
2006-11-14 23:52   ` Brian May
2006-11-15  0:07     ` Ludovic Brenta
replies disabled

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