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,3869f0598191b11d X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!proxad.net!fr.ip.ndsoftware.net!216.196.110.149.MISMATCH!border2.nntp.ams.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!news2.telebyte.nl!news.jgaa.com!news.hacking.dk!pnx.dk!munin.nbi.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Porting Ada source Date: 19 Jul 2004 14:23:57 +0200 Organization: Munin Sender: sparre@sparre.crs4.it Message-ID: References: NNTP-Posting-Host: sparre.crs4.it Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: munin.nbi.dk 1090239838 31442 156.148.70.170 (19 Jul 2004 12:23:58 GMT) X-Complaints-To: sparre@munin.nbi.dk NNTP-Posting-Date: Mon, 19 Jul 2004 12:23:58 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:2231 Date: 2004-07-19T14:23:57+02:00 List-Id: 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!"