comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: GNAT - filename/unitname question
Date: Thu, 29 Sep 2005 20:09:58 +0100
Date: 2005-09-29T20:09:58+01:00	[thread overview]
Message-ID: <m2psqrg06x.fsf@grendel.local> (raw)
In-Reply-To: 433bc753@news.upm.es

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).



      parent reply	other threads:[~2005-09-29 19:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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