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,49b52b8065390e5a X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!cyclone1.gnilink.net!gnilink.net!nx01.iad.newshosting.com!newshosting.com!demorgan.zen.co.uk!zen.net.uk!hamilton.zen.co.uk!feeder2-2.proxad.net!proxad.net!feeder1-1.proxad.net!oleane.net!oleane!hunter.axlog.fr!nobody From: Jean-Pierre Rosen Newsgroups: comp.lang.ada Subject: Re: Ada Plattform Independence Date: Thu, 12 Mar 2009 10:44:16 +0100 Organization: Adalog Message-ID: References: <82d07df7-bee1-4fd4-b0e1-dd10f43f9f60@q1g2000vbn.googlegroups.com> NNTP-Posting-Host: mailhost.axlog.fr Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: s1.news.oleane.net 1236843840 29466 195.25.228.57 (12 Mar 2009 07:44:00 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Thu, 12 Mar 2009 07:44:00 +0000 (UTC) User-Agent: Thunderbird 2.0.0.19 (Windows/20081209) In-Reply-To: Xref: g2news2.google.com comp.lang.ada:5031 Date: 2009-03-12T10:44:16+01:00 List-Id: 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