From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c8c8b9fc03b0d98f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!newsfeed.icl.net!peer-uk.news.demon.net!kibo.news.demon.net!mutlu.news.demon.net!news.demon.co.uk!demon!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: GNAT - filename/unitname question Date: Thu, 29 Sep 2005 20:09:58 +0100 Organization: Pushface Message-ID: References: <433bc753@news.upm.es> NNTP-Posting-Host: pogner.demon.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.demon.co.uk 1128020996 22704 62.49.19.209 (29 Sep 2005 19:09:56 GMT) X-Complaints-To: abuse@demon.net NNTP-Posting-Date: Thu, 29 Sep 2005 19:09:56 +0000 (UTC) Cancel-Lock: sha1:87fIwsaaPueRxi41KZ+gerz0n3E= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (darwin) Xref: g2news1.google.com comp.lang.ada:5280 Date: 2005-09-29T20:09:58+01:00 List-Id: Manuel Collado 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).