comp.lang.ada
 help / color / mirror / Atom feed
From: Jean-Pierre Rosen <rosen@adalog.fr>
Subject: Re: Ada Plattform Independence
Date: Thu, 12 Mar 2009 10:44:16 +0100
Date: 2009-03-12T10:44:16+01:00	[thread overview]
Message-ID: <rhlapg.uqs.ln@hunter.axlog.fr> (raw)
In-Reply-To: <c53dc282-a11b-40ad-86d7-3533181b46d4@p20g2000yqi.googlegroups.com>

patrick.gunia@googlemail.com a �crit :
>> -Differences on the implementation of Address. Some compilers (mainly
>> Ada83) defined Address as an integer type, while current common practice
>> is to make it private, which causes problems if people are doing
>> (uncontrolled) address arithmetic
> 
> I also thought of this aspect. I have the big advantage that the
> software is only executed on a very limited range of hardware
> configurations. Using the same compiler implementation for different
> plattforms (for example GNAT) would solve this problem?
AFAIK, GNAT (and presumably most Ada95 compilers, since it is
implementation advice) define Address as private

>> -Representation clauses. Compilers vary in their support of
>> representation clauses, sometimes for good reasons: some representation
>> clauses that are acceptable on some targets would lead to unreasonable
>> code on a different hardware. Representation clauses may also depend on
>> predefined types; f.e., if you have a record field of type Duration, you
>> may have problems when moving a program from an implementation where
>> Duration is 32 bits to one where Duration is 64 bits
> 
> Same aspect as above, when I use GNAT on GNU/Linux and Windows to
> compile this code, it should use the same implementation of Duration?
This might depend on the target. But why are you asking? Just try it!
(i.e. if there is a problem, it won't compile; no risk at run-time)

>> -Outrageously wrong code written by people who write "C-in-Ada", with
>> lots of unchecked conversions between pointers and addresses.
> 
> The code uses unchecked_conversions to call imported C-functions. I don
> �t think that I can avoid this problem. Though the software is always
> executed on 32-Bit systems, thus this should also work out, or am I
> getting something terribly wrong here?
Unchecked_Conversion was commonly used in Ada83. Using pragma Import and
Interfaces.C is preferred since Ada95. I would suggest migrating the
code to use these features.


-- 
---------------------------------------------------------
           J-P. Rosen (rosen@adalog.fr)
Visit Adalog's web site at http://www.adalog.fr



  reply	other threads:[~2009-03-12  9:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11 14:04 Ada Plattform Independence patrick.gunia
2009-03-11 15:37 ` Jean-Pierre Rosen
2009-03-11 17:00   ` patrick.gunia
2009-03-12  9:44     ` Jean-Pierre Rosen [this message]
2009-03-11 17:33 ` Martin
replies disabled

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