Re: GNAT - filename/unitname question



Manuel Collado <m.collado@xxxxxxxxxxxxxxxx> 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).
.



Relevant Pages

  • Re: C++ Project Files?????
    ... by the compiler. ... executables, because the code of the function is duplicated instead of ... object files are not really standardized. ... > unsigned long int square; ...
    (comp.lang.cpp)
  • Re: Compiling Problem with LibCurl
    ... containing object files and hence shouldn't be included on the CC line. ... The LINK command is then used to link the object files and libraries. ... The C compiler has a process for finding include files. ... it finds those which ship with the compiler, curl isn't one of those. ...
    (comp.os.vms)
  • Re: Object files
    ... Put floppy disk in computer. ... > brand of compiler, linker or another version of the same compiler. ... of software in object or library (collection of object files) form, ... dozens of libraries supplied in object form, ...
    (comp.lang.c)
  • Re: C++ Project Files?????
    ... The C preprocessor *merges* the header files with the source files ... > What the is a library file? ... > files have been turned into object files, ... that came with your compiler. ...
    (comp.lang.cpp)
  • Re: How to set my own program startup in f77 programs other than MAIN__
    ... But we don't have the source file where ... whatever they call it these days) compiler. ... I think the whole approach of stuffing your initializer into a ... "Operation of the Runtime Linker ...
    (comp.lang.fortran)