comp.lang.ada
 help / color / mirror / Atom feed
From: "G.B." <bauhaus@futureapps.invalid>
Subject: Re: Can .ads be compiled alone?
Date: Fri, 07 Nov 2014 17:29:03 +0100
Date: 2014-11-07T17:29:03+01:00	[thread overview]
Message-ID: <m3is06$iod$1@dont-email.me> (raw)
In-Reply-To: <m3ipjc$7f6$1@dont-email.me>

On 07.11.14 16:49, Björn Lundin wrote:
> On 2014-11-07 15:54, Tero Koskinen wrote:
>> 7.11.2014 9:48, Chris Moore wrote:
>>> You cannot generate code from a spec.
>>
>> I think this isn't true anymore for Ada 2012?
>>
>
> It was never true, if the body was not needed


As always, the

    ~*~  GNAT User's Guide  ~*~

is a helpful source of information about using GNAT.
It's free and it is included with every installation
of GNAT.

(I should offer an initial donation of $10 to a team tasked
with creating a nice video of someone presenting just its first
sections in a skilful way, on camera. People don't want to read,
even when the Guide is very well written. But they do want
to watch.)

Here is the relevant section(*):

<quote>
3.1 Compiling Programs
======================

(...)

You need _not_ compile the following files

    * the spec of a library unit which has a body

    * subunits

because they are compiled as part of compiling related units. GNAT
package specs when the corresponding body is compiled, and subunits
when the parent is compiled.

    If you attempt to compile any of these files, you will get one of the
following error messages (where FFF is the name of the file you
compiled):

      cannot generate code for file FFF (package spec)
      to check package spec, use -gnatc

      cannot generate code for file FFF (missing subunits)
      to check parent unit, use -gnatc

      cannot generate code for file FFF (subprogram spec)
      to check subprogram spec, use -gnatc

      cannot generate code for file FFF (subunit)
      to check subunit, use -gnatc

As indicated by the above error messages, if you want to submit one of
these files to the compiler to check for correct semantics without
generating code, then use the `-gnatc' switch.
</quote>

__
(*) It would be nice to see GNAT's documentation linked at
stackexchange.


  reply	other threads:[~2014-11-07 16:29 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07  5:21 Can .ads be compiled alone? moixa
2014-11-07  6:09 ` Jeffrey Carter
2014-11-07 17:26   ` Robert A Duff
2014-11-07 17:41     ` Jeffrey Carter
2014-11-07  6:20 ` J-P. Rosen
2014-11-07  7:48 ` Chris Moore
2014-11-07 14:54   ` Tero Koskinen
2014-11-07 15:49     ` Björn Lundin
2014-11-07 16:29       ` G.B. [this message]
2014-11-08 13:01         ` moixa
2014-11-08 14:55           ` G.B.
2014-11-07 16:29       ` G.B.
2014-11-07 16:44     ` Adam Beneschan
2014-11-07 17:14   ` Shark8
2014-11-08 21:31     ` Chris Moore
2014-11-07 16:50 ` Adam Beneschan
2014-11-07 17:14   ` Robert A Duff
2014-11-08  2:01     ` Randy Brukardt
2014-11-15 12:54 ` rriehle
2014-11-15 19:17   ` Robert A Duff
2014-11-15 19:19     ` Robert A Duff
2014-11-17 15:52       ` Adam Beneschan
2014-11-17  0:07     ` rriehle
2014-11-17  6:50       ` Simon Wright
2014-11-24  3:16     ` rriehle
2014-11-24  6:34       ` Jeffrey Carter
replies disabled

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