comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: GnatLib vs. pragma Interface
Date: 1997/08/20
Date: 1997-08-20T00:00:00+00:00	[thread overview]
Message-ID: <dewar.872126541@merv> (raw)
In-Reply-To: swhalenEF8Bys.M45@netcom.com


Steve asks

<<I'm curious as to why the pragma Interface's are used there.  Are they
a left over from a conversion from Ada83 code, or is there a positive
reason they're used?

I use the GNAT source code as a resource to remind myself of what good
Ada95 code looks like<g>. and this one has me puzzled.>>

pragma Interface is not an official part of Ada 95, but in practice it
will be supported by any reasonable Ada 95 compiler (you can make sure
you avoid such uses if you like by using

  pragma Restrictions (Implementation_Pragmas)

(which unfortunately is not a standard feature ...)

<<According to the Ada95 rational, "pragma Import" is to be preferred in
 Ada95 over "pragma Interface" (obsoleted from Ada83 I believe).  I
 think it did say that the two were functionally equivalent.>>

If the Rationale says this, it is wrong. The Ada 83 pragma is definitely
NOT equivalent to the Ada 95 Import pragma (although in GNAT, Interface
is extended to be equivalent). And as noted above, Interface is NOT IN
Ada 95, so it is not just an obsolescent feature which someone thinks
is bad style to use, it is a potentially non-portable interface (not
that this is a consideration in the GNAT sources themselves).

The GNAT code should indeed use Import, and you may award yourself a prize
for finding a bug in the GNAT sources. If you send it off to report@gnat.com,
it will no doubt get fixed :-)

Of course this is not exactly the most critical bug located recently -- but
on the other hand, cleaning up the sources is a valuable long term goal!





  reply	other threads:[~1997-08-20  0:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-08-20  0:00 GnatLib vs. pragma Interface Steve Whalen
1997-08-20  0:00 ` Robert Dewar [this message]
1997-08-21  0:00   ` Steve Whalen
1997-08-21  0:00     ` Robert Dewar
replies disabled

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