comp.lang.ada
 help / color / mirror / Atom feed
From: root <root@vf700f.msfc.nasa.gov>
Subject: Re: What's wrong with this?
Date: 1997/05/19
Date: 1997-05-19T00:00:00+00:00	[thread overview]
Message-ID: <Pine.LNX.3.95.970519092151.506B-100000@vf700f.msfc.nasa.gov> (raw)
In-Reply-To: dewar.863816747@merv


On 16 May 1997, Robert Dewar wrote:

> Anders says
> 
> <<when compiled ( gcc -c filename ), generates the following error:
> 
> 'pragma "Export" requires separate spec and must come before body'.
> 
> The example is directly out of the GNAT Documents INTRO Rev 1.98, from
> the section 'Building a Program where the Main Program is not in Ada'.  I
> have now seen various examples with 'pragma Export' used this way, the
> implication is that this should work.>>
> 
> 
> Nope, the example is wrong (and does not appear in the current GNAT 
> documentation).

Ok, the example is incorrect, no problem, however, I just ( as in 10
minutes ago ) downloaded the following:

gnat-3.09-i486-linux-elf-bin.tar.gz

from cs.nyu.edu, and I'm looking at the gnatinfo.txt file ( GNAT DOCUMENTS
INTRO $Revision 1.104$ ) included in this distribution.  In the section
'Building a Program where the Main Program is not in Ada' there is the
following example:

  Main program (m.c)

    main()
    {
      adainit();
      Header();
      adafinal();
    }

  Ada subroutine (header.adb)

    with Text_IO; use Text_IO;
    procedure Header is
    begin
       put_line ("Header");
    end;
    pragma Export (C, Header, "Header");

    Compile the units
    
      gcc -c m.c
      gcc -c header.adb
    
    Bind
    
      gnatbind -n header.ali
    
    Link
    
      gnatlink header.ali m.o
    
    Run
    
      header
 
As I understand the situation, gnat 3.09 is the latest release.  I guess
what I would like to know is, what is the latest documentation I'm
supposed to be looking at.  Also, if this example is incorrect, why is it
included in two releases of gnat ( 3.07 & 3.09 )?  This is confusing to
the newcomer :).

AE

address e-mail replies to:
eliasson@logan.msfc.nasa.gov





      reply	other threads:[~1997-05-19  0:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-05-16  0:00 What's wrong with this? Anders Eliasson
1997-05-16  0:00 ` Robert Dewar
1997-05-19  0:00   ` root [this message]
replies disabled

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