comp.lang.ada
 help / color / mirror / Atom feed
* Stackoverflow answer in need of update?
@ 2015-02-23 17:50 G.B.
  2015-02-23 21:04 ` Simon Wright
  2015-02-24 17:55 ` Florian Weimer
  0 siblings, 2 replies; 11+ messages in thread
From: G.B. @ 2015-02-23 17:50 UTC (permalink / raw)


http://stackoverflow.com/questions/16182824/ada-beginner-stack-program

claims that gcc needs a 1:1 correspondence of compilation units
and files. However, there now is -gnateINNN, in view of which this
might no longer be true as is. (I do not know the details or its
convenience as a solution, but maybe that's worth an update.)


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Stackoverflow answer in need of update?
  2015-02-23 17:50 Stackoverflow answer in need of update? G.B.
@ 2015-02-23 21:04 ` Simon Wright
  2015-02-23 21:10   ` Simon Wright
  2015-02-24 17:55 ` Florian Weimer
  1 sibling, 1 reply; 11+ messages in thread
From: Simon Wright @ 2015-02-23 21:04 UTC (permalink / raw)


"G.B." <bauhaus@futureapps.invalid> writes:

> http://stackoverflow.com/questions/16182824/ada-beginner-stack-program
>
> claims that gcc needs a 1:1 correspondence of compilation units
> and files. However, there now is -gnateINNN, in view of which this
> might no longer be true as is. (I do not know the details or its
> convenience as a solution, but maybe that's worth an update.)

The OP there said "I am totally new to Ada and also how to compile 2
files", so I suspect that the only sensible way of using this feature
(to use gnatname to update a project file) would be inappropriate.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Stackoverflow answer in need of update?
  2015-02-23 21:04 ` Simon Wright
@ 2015-02-23 21:10   ` Simon Wright
  2015-02-24 12:21     ` G.B.
  0 siblings, 1 reply; 11+ messages in thread
From: Simon Wright @ 2015-02-23 21:10 UTC (permalink / raw)


Simon Wright <simon@pushface.org> writes:

> "G.B." <bauhaus@futureapps.invalid> writes:
>
>> http://stackoverflow.com/questions/16182824/ada-beginner-stack-program
>>
>> claims that gcc needs a 1:1 correspondence of compilation units and
>> files. However, there now is -gnateINNN, in view of which this might
>> no longer be true as is. (I do not know the details or its
>> convenience as a solution, but maybe that's worth an update.)
>
> The OP there said "I am totally new to Ada and also how to compile 2
> files", so I suspect that the only sensible way of using this feature
> (to use gnatname to update a project file) would be inappropriate.

And I don't see how to use it to produce an executable.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Stackoverflow answer in need of update?
  2015-02-23 21:10   ` Simon Wright
@ 2015-02-24 12:21     ` G.B.
  0 siblings, 0 replies; 11+ messages in thread
From: G.B. @ 2015-02-24 12:21 UTC (permalink / raw)


On 23.02.15 22:10, Simon Wright wrote:
> And I don't see how to use it to produce an executable.

I'm still experimenting; the following command produces an
executable from a single source file with the help of gnatmake
only.

(This is perhaps nitpicking, but I still think it might be worth
adding that the "old" rule of 1 compilation unit per file
is no longer an absolute requirement.)

$ gnatmake -gnatl -gnateI1 multi.ada  -gnateI2
gcc -c -gnatl -gnateI1 -gnateI2 -x ada multi.ada

GNAT GPL 2014 (20140331)
Copyright 1992-2014, Free Software Foundation, Inc.


Compiling: multi.ada (source file time stamp: 2015-02-24 12:14:35)

      1. with Another;
      2.
      3. procedure Multi
      4. is begin
      5.    null;
      6. end Multi;
      7.
      8. with Ada.Text_IO;
      9. procedure Another
     10. is begin
     11.    Ada.Text_IO.Put_Line ("Another");
     12. end Another;
     13.

  13 lines: No errors
gnatbind -x multi.ali
gnatlink multi.ali
$ ./multi
Another
$

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Stackoverflow answer in need of update?
  2015-02-23 17:50 Stackoverflow answer in need of update? G.B.
  2015-02-23 21:04 ` Simon Wright
@ 2015-02-24 17:55 ` Florian Weimer
  2015-02-24 18:30   ` J-P. Rosen
  1 sibling, 1 reply; 11+ messages in thread
From: Florian Weimer @ 2015-02-24 17:55 UTC (permalink / raw)


* G. B.:

> http://stackoverflow.com/questions/16182824/ada-beginner-stack-program
>
> claims that gcc needs a 1:1 correspondence of compilation units
> and files. However, there now is -gnateINNN, in view of which this
> might no longer be true as is. (I do not know the details or its
> convenience as a solution, but maybe that's worth an update.)

I have not read the referenced posting, but the 1:1 has never been
true because of the .ads/.adb split and subunits, so compilation units
can span multiple files.

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Stackoverflow answer in need of update?
  2015-02-24 17:55 ` Florian Weimer
@ 2015-02-24 18:30   ` J-P. Rosen
  2015-02-25 13:14     ` AdaMagica
  0 siblings, 1 reply; 11+ messages in thread
From: J-P. Rosen @ 2015-02-24 18:30 UTC (permalink / raw)


Le 24/02/2015 18:55, Florian Weimer a écrit :
> * G. B.:
> 
>> http://stackoverflow.com/questions/16182824/ada-beginner-stack-program
>>
>> claims that gcc needs a 1:1 correspondence of compilation units
>> and files. However, there now is -gnateINNN, in view of which this
>> might no longer be true as is. (I do not know the details or its
>> convenience as a solution, but maybe that's worth an update.)
> 
> I have not read the referenced posting, but the 1:1 has never been
> true because of the .ads/.adb split and subunits, so compilation units
> can span multiple files.
> 
Program units yes, but not compilation units. Watchout the vocabulary ;-)

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Stackoverflow answer in need of update?
  2015-02-24 18:30   ` J-P. Rosen
@ 2015-02-25 13:14     ` AdaMagica
  2015-02-25 14:02       ` J-P. Rosen
  0 siblings, 1 reply; 11+ messages in thread
From: AdaMagica @ 2015-02-25 13:14 UTC (permalink / raw)


Am Dienstag, 24. Februar 2015 19:31:52 UTC+1 schrieb J-P. Rosen:
...
> Program units yes, but not compilation units. Watchout the vocabulary ;-)

Hm, there is no syntactical categorie program_unit. There is

  RM 10.1.1(2) compilation ::= {compilation_unit}

and GNAT in *standard mode* requires one compilation_unit per file (as does APEX).

However, if you write e.g.

  gnatmake some_unit.ads,

what really happens is that some_unit is the given compilation_unit, but GNAT (and for that matter any modern compiler) will make a compilation of all compilation_units needed to compile the given unit. This compilation will then generally comprise many files.


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Stackoverflow answer in need of update?
  2015-02-25 13:14     ` AdaMagica
@ 2015-02-25 14:02       ` J-P. Rosen
  2015-02-27 10:28         ` AdaMagica
  0 siblings, 1 reply; 11+ messages in thread
From: J-P. Rosen @ 2015-02-25 14:02 UTC (permalink / raw)


Le 25/02/2015 14:14, AdaMagica a écrit :
>> Program units yes, but not compilation units. Watchout the vocabulary ;-)
> Hm, there is no syntactical categorie program_unit. There is
Syntactical no, but see 10.1(1)

-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Stackoverflow answer in need of update?
  2015-02-25 14:02       ` J-P. Rosen
@ 2015-02-27 10:28         ` AdaMagica
  2015-02-27 11:00           ` J-P. Rosen
  0 siblings, 1 reply; 11+ messages in thread
From: AdaMagica @ 2015-02-27 10:28 UTC (permalink / raw)


Am Mittwoch, 25. Februar 2015 15:02:41 UTC+1 schrieb J-P. Rosen:
> Le 25/02/2015 14:14, AdaMagica a écrit :
> >> Program units yes, but not compilation units. Watchout the vocabulary ;-)
> > Hm, there is no syntactical categorie program_unit. There is
> Syntactical no, but see 10.1(1)

Of course, but there is no direct relation to compilation units. Program units are included in compilation units, some distributed over many compilation units (think of cascading separates).

^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Stackoverflow answer in need of update?
  2015-02-27 10:28         ` AdaMagica
@ 2015-02-27 11:00           ` J-P. Rosen
  2015-02-27 13:53             ` AdaMagica
  0 siblings, 1 reply; 11+ messages in thread
From: J-P. Rosen @ 2015-02-27 11:00 UTC (permalink / raw)


Le 27/02/2015 11:28, AdaMagica a écrit :
> Of course, but there is no direct relation to compilation units.
> Program units are included in compilation units, some distributed
> over many compilation units (think of cascading separates).

Yes, but that was precisely your point. You said that a compilation unit
(in Gnat) could be in several files, and I made a point of vocabulary
that the program unit was spread over several files, but each file was a
single compilation unit.
-- 
J-P. Rosen
Adalog
2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
http://www.adalog.fr


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: Stackoverflow answer in need of update?
  2015-02-27 11:00           ` J-P. Rosen
@ 2015-02-27 13:53             ` AdaMagica
  0 siblings, 0 replies; 11+ messages in thread
From: AdaMagica @ 2015-02-27 13:53 UTC (permalink / raw)


Am Freitag, 27. Februar 2015 12:00:24 UTC+1 schrieb J-P. Rosen:
> Le 27/02/2015 11:28, AdaMagica a écrit :
> > Of course, but there is no direct relation to compilation units.
> > Program units are included in compilation units, some distributed
> > over many compilation units (think of cascading separates).
> 
> Yes, but that was precisely your point. You said that a compilation unit

That was Florian Weimer

> (in Gnat) could be in several files, and I made a point of vocabulary
> that the program unit was spread over several files, but each file was a
> single compilation unit.
> -- 
> J-P. Rosen
> Adalog
> 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX
> Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00
> http://www.adalog.fr


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-02-27 13:53 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-23 17:50 Stackoverflow answer in need of update? G.B.
2015-02-23 21:04 ` Simon Wright
2015-02-23 21:10   ` Simon Wright
2015-02-24 12:21     ` G.B.
2015-02-24 17:55 ` Florian Weimer
2015-02-24 18:30   ` J-P. Rosen
2015-02-25 13:14     ` AdaMagica
2015-02-25 14:02       ` J-P. Rosen
2015-02-27 10:28         ` AdaMagica
2015-02-27 11:00           ` J-P. Rosen
2015-02-27 13:53             ` AdaMagica

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