comp.lang.ada
 help / color / mirror / Atom feed
* GNAT - filename/unitname question
@ 2005-09-29 10:52 Manuel Collado
  2005-09-29 12:49 ` Georg Bauhaus
  2005-09-29 19:09 ` Simon Wright
  0 siblings, 2 replies; 3+ messages in thread
From: Manuel Collado @ 2005-09-29 10:52 UTC (permalink / raw)


Consider the following source file:

filename.adb
------------
   procedure unitname is
   begin
      ...
   end unitname;

Compiling it gives a warning:

   filename.adb:1:11: warning: file name does not match unit name, should
   be "unitname.adb"

And generates the files:

   filename.ali
   filename.o


The question is: is there a gcc switch or GNAT pragma to force the 
compiler to use the unitname for the object files? To have:

   unitname.ali
   unitname.o

instead of filename.* object files.

I've read the GNAT documentation for gcc switches and pragmas, but found 
nothing useful.

Thanks,
-- 
To reply by e-mail, please remove the extra dot
in the given address:  m.collado -> mcollado



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

* Re: GNAT - filename/unitname question
  2005-09-29 10:52 GNAT - filename/unitname question Manuel Collado
@ 2005-09-29 12:49 ` Georg Bauhaus
  2005-09-29 19:09 ` Simon Wright
  1 sibling, 0 replies; 3+ messages in thread
From: Georg Bauhaus @ 2005-09-29 12:49 UTC (permalink / raw)


Manuel Collado wrote:

 [file naming]
> I've read the GNAT documentation for gcc switches and pragmas, but found 
> nothing useful.

IIRC, pragma Source_File_Name provides some scheme.



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

* Re: GNAT - filename/unitname question
  2005-09-29 10:52 GNAT - filename/unitname question Manuel Collado
  2005-09-29 12:49 ` Georg Bauhaus
@ 2005-09-29 19:09 ` Simon Wright
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Wright @ 2005-09-29 19:09 UTC (permalink / raw)


Manuel Collado <m.collado@lml.ls.fi.upm.es> writes:

> Consider the following source file:
>
> filename.adb
> ------------
>    procedure unitname is
>    begin
>       ...
>    end unitname;
>
> Compiling it gives a warning:
>
>    filename.adb:1:11: warning: file name does not match unit name, should
>    be "unitname.adb"
>
> And generates the files:
>
>    filename.ali
>    filename.o
>
>
> The question is: is there a gcc switch or GNAT pragma to force the
> compiler to use the unitname for the object files? To have:
>
>    unitname.ali
>    unitname.o
>
> instead of filename.* object files.
>
> I've read the GNAT documentation for gcc switches and pragmas, but
> found nothing useful.

You could compile with -gnatwe to treat warnings as errors. This may
be beyond what you are looking for :-)

On the whole,most people find it easier to go with what the compiler
wants (you could try gnatchop; it takes the units in an arbitrary
source file and outputs each unit in the "expected" file).



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

end of thread, other threads:[~2005-09-29 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-09-29 10:52 GNAT - filename/unitname question Manuel Collado
2005-09-29 12:49 ` Georg Bauhaus
2005-09-29 19:09 ` Simon Wright

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