comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: Porting Ada source
Date: 19 Jul 2004 14:23:57 +0200
Date: 2004-07-19T14:23:57+02:00	[thread overview]
Message-ID: <pld62sdw2q.fsf@sparre.crs4.it> (raw)
In-Reply-To: cdfu3s$k1a$1@e3k.asi.ansaldo.it

Giacomo Polizzi wrote:

> I have to port an Ada program from an Unix DEC Alpha machine with a
> DEC Ada compiler to a Linux pc machine with gnat (gcc) compiler.
> 
> The task is to have, if possible, an unique source code compilable
> on both platforms but there are the following problems:
> 
> 1) some system packages that execute the same kind of operations
> have different names in the two compilers

This is probably because the DEC Ada compiler is an Ada 83 compiler,
whereas GNAT primarily is an Ada 95 compiler (I think it may have an
Ada 83 mode).

> 2) some system functions (for example mathematical function) have
> different names in the two compilers

Same as above.

> 3) the word length is 64 bits on DEC Alpha and 32 bits on pc so it
> is not always possible to use the same standard type (for example
> the long type is 64 bits on Alpha and 32 bits on pc)

If the program has been written in terms of the requirements and not
just in term of standard data types, this is unlikely to create
significant problems.  If the program depends on the actual range of
the type Integer, then you may have to rework some of the code.  But
based on previous experience reports on porting of code, I will guess
that it isn't that much work.

> 4) the standard type (long long) used by gcc on pc to solve the
> previous problem is not supported by the DEC Ada compiler

That doesn't matter if you just declare your integer types in terms of
the requirements.

> 5) the different word length modifies some structure length used to
> define interface messages with other external programs

I don't really know much about how representation clauses were done in
Ada 83, so I can't help you here.

> Is there something like #IFDEF of C language that I can use in Ada?

Fortunately not.  Unfortunately there are not a more sensible method
of conditional compilation built into the language either.

Jacob
-- 
"I'm going as a barrel of toxic waste!"



  parent reply	other threads:[~2004-07-19 12:23 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-19  7:42 Porting ADA source Giacomo Polizzi
2004-07-19 11:04 ` Dale Stanbrough
2004-07-19 12:14   ` Marin David Condic
2004-07-19 18:46     ` tmoran
2004-07-20  0:44       ` Marin David Condic
2004-07-20 11:18       ` Peter C. Chapin
2004-07-20 11:41         ` Martin Dowie
2004-07-20 11:59           ` Marin David Condic
2004-07-20 13:02             ` Georg Bauhaus
2004-07-20 18:49             ` Jeffrey Carter
2004-07-20 22:51             ` Randy Brukardt
2004-07-21  0:35               ` Robert I. Eachus
2004-07-21 12:24                 ` Marin David Condic
2004-07-22 22:48                   ` Robert I. Eachus
2004-07-23 13:00                     ` Marin David Condic
2004-07-24  3:04                       ` Robert I. Eachus
2004-07-24 11:48                         ` Marin David Condic
2004-07-24 12:42                           ` Robert I. Eachus
2004-07-26 18:39                             ` Marin David Condic
2004-08-17  4:28               ` Ronald Price
2004-08-17 11:28                 ` Frank J. Lhota
2004-07-19 11:09 ` Adrian Knoth
2004-07-19 12:23 ` Jacob Sparre Andersen [this message]
2004-07-19 18:05   ` Porting Ada source Jean-Pierre Rosen
2004-07-19 13:39 ` Porting ADA source Steve
2004-07-20  0:54   ` Marin David Condic
2004-07-19 18:05 ` Martin Dowie
2004-07-19 19:33   ` Wes Groleau
2004-07-19 20:03     ` Larry Kilgallen
2004-07-19 20:29       ` Wes Groleau
2004-07-20 16:13         ` Martin Krischik
2004-07-19 21:36     ` Martin Dowie
2004-07-20 12:14       ` Frank J. Lhota
2004-07-20 12:27         ` Vinzent 'Gadget' Hoefler
2004-07-20 13:13 ` Peter Amey
2004-07-21  6:20 ` Volkert
2004-07-31 16:04 ` Richard  Riehle
replies disabled

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