comp.lang.ada
 help / color / mirror / Atom feed
* Re: Can't use my ".ada" files with Gnat 3.09?
       [not found] <wn90z5z6u0.fsf@ms31.sp.trw.com>
@ 1997-07-18  0:00 ` John Howard
  1997-07-19  0:00 ` Robert Dewar
  1 sibling, 0 replies; 4+ messages in thread
From: John Howard @ 1997-07-18  0:00 UTC (permalink / raw)
  To: flower


> gcc -c -g temp.ada
> temp.ada:4:11: warning: file name does not match unit name, should be
> "temp.adb"

Simply rename temp.ada to temp.adb and type "gnatmake temp".

GNAT defaults expect an extension "ads" for specification and "adb" for
body. You have two options: either rename your programs to match the 
defaults, or use a compiler directive to change the defaults. GNAT has 
documentation. Additional documentation is found with the distribution of 
gcc.

-- John Howard <jhoward@sky.net>               -- Team Ada  Team OS/2 --





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

* Re: Can't use my ".ada" files with Gnat 3.09?
       [not found] <wn90z5z6u0.fsf@ms31.sp.trw.com>
  1997-07-18  0:00 ` Can't use my ".ada" files with Gnat 3.09? John Howard
@ 1997-07-19  0:00 ` Robert Dewar
       [not found]   ` <wnu3ho10fs.fsf@ms31.sp.trw.com>
  1 sibling, 1 reply; 4+ messages in thread
From: Robert Dewar @ 1997-07-19  0:00 UTC (permalink / raw)



flowers said

<<Hi.. I just started playing around with GNAT again (3.09 Sparc/Solaris)
after finishing up some work with GHS Ada'83, and thought that I would
try some of my Ada'83 code w/ Gnat.. Anyway, I'm getting an error that
I don't understand when trying to compile any file that ends with ".ada"
instead of ".adb".. I looked at the code for Gnat, but wasn't able to
determine what is was complaining about.. Any ideas? >>

I have an amazing suggestion: read the documentation! It surpsises me
how people expect to use complex systems these days without reading
the documentation. A compiler is not a word processor!

Of course the error message also clearly told you how to solve the
problem (rename your file xxx.adb).

If you do read the documentation, you will find out that GNAT either
requires that you use the default file name conventions, or that
you go throughy the necessary steps to use non-default names, I
suggest the former, especially if you don't feel like reading the
documentation!

If you do want to explore the code, look at the fname and uname routines,
these make the situation pretty clear!





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

* Re: Can't use my ".ada" files with Gnat 3.09?
       [not found]   ` <wnu3ho10fs.fsf@ms31.sp.trw.com>
@ 1997-07-22  0:00     ` Robert Dewar
  1997-07-22  0:00     ` Gautier
  1 sibling, 0 replies; 4+ messages in thread
From: Robert Dewar @ 1997-07-22  0:00 UTC (permalink / raw)



flower says

<<There is NOTHING in the documentation that clearly (and in plain
English) states that you CAN'T use ".ada", or at least lists the
prerequisites needed if you DO use .ada...  At best if you read
between the lines, you can imply this fact!
>>


It is all there in the users guide, what documentation are you reading?????

In the secion called File Naming Rules (not exactly an obscure title),
we find:

The default file name is determined by the name of the unit the file contains.
The name is formed by taking the full expanded name of the unit and
replacing the separating dots with hyphens and using lower case for all
letters except that a hyphen in the second character position is
replaced by a plus sign. The extension is @file{.ads} for a spec and
@file{.adb} for a body as shown in the following table.


Seems pretty clear to me, and no, there is nothing "standard" about using
an exception of ".ada" -- that is merely the convention used by one
particular compiler or user of a compiler in the past, and you just assumed
it was some kind of standard without any reason to.

The words you quote about file names recognized by gcc is another
issue completely. As you know gcc uses the extension of the file to
determine what language you are writing in. As you correctly noted
in your quote, gcc will assume the language is ada if the file extension
is ada, adb, or ads. But that has nothing to do with the default
conventions.

If you use other than ads and adb, you will need to follow the directions in
the docyumentation on using other than default names. If your file extension
is other than ada, adb, or ads, then you need to use a -x ada switch
to tell gcc that the file is an ada file.

But I suspect that the problem here is that in fact you do not have the
GNAT documentation at hand!

Robert Dewar
Ada Corte Technologies





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

* Re: Can't use my ".ada" files with Gnat 3.09?
       [not found]   ` <wnu3ho10fs.fsf@ms31.sp.trw.com>
  1997-07-22  0:00     ` Robert Dewar
@ 1997-07-22  0:00     ` Gautier
  1 sibling, 0 replies; 4+ messages in thread
From: Gautier @ 1997-07-22  0:00 UTC (permalink / raw)



(...)
> "Gcc recognizes the ada filename extensions .ads and .adb..."
> 
> followed later by :
> 
> Unless the extension of the filename is ".ads", ".adb", or ".ada"...
> 
> There is NOTHING in the documentation that clearly (and in plain
> English) states that you CAN'T use ".ada", or at least lists the 
> prerequisites needed if you DO use .ada...  At best if you read
> between the lines, you can imply this fact!

BTW, the usage of ".ada" could be an interesting new feature of GNAT
as the extension of files containing both specification and body of
a package, like with other compilers.

Gautier





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

end of thread, other threads:[~1997-07-22  0:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <wn90z5z6u0.fsf@ms31.sp.trw.com>
1997-07-18  0:00 ` Can't use my ".ada" files with Gnat 3.09? John Howard
1997-07-19  0:00 ` Robert Dewar
     [not found]   ` <wnu3ho10fs.fsf@ms31.sp.trw.com>
1997-07-22  0:00     ` Robert Dewar
1997-07-22  0:00     ` Gautier

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