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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,976a050e0f89277c X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Urgent question: malloc and ada...READ/NEW/FOLLOWUP Date: 1998/04/26 Message-ID: #1/1 X-Deja-AN: 347967400 References: <352A79C2.15FB7483@nathan.gmd.de> <1998Apr10.073110.1@eisner> <6hvm8k$t3l$1@news.hal-pc.org> X-Complaints-To: usenet@news.nyu.edu X-Trace: news.nyu.edu 893643684 29323 (None) 128.122.140.58 Organization: New York University Newsgroups: comp.lang.ada Date: 1998-04-26T00:00:00+00:00 List-Id: Jonathan says <> First of all, multiple C compilers per se is not a problem unless they use incompatible data layouts or calling sequences. On most machines the data layout and calling sequence is pretty much fixed, with more or less official help from the official ABI. If there is more than one C compiler, then the Ada compiler implementor is expected to either specify what particular C compiler is to be used or to provide multiple possible selections (e.g. by using diffent convention names, as perhaps in pragma Convention (Borland_C, ...); In practice this has not proved necessary in any environment we have seen. You make an assumption in the quoted paragraph above which is quite incorrect, namely that GNAT is tailored to what GCC does. This is the wrong way of looking at things. In fact GNU C (that's actually what you really mean by GCC here) goes to great efforts to be 100% compatible in data layouts and calling sequences with whatever is the "standard" C compiler in a given environment. Indeed it is regarded as a bug if GNU C is not 100% compatible with the "standard" vendor compiler. Thus the right way to look at things is that both GNU C, and GNAT (with respect to pragma Convention C) make sure to be compatible with the standard C compiler conventions. As to the information not being available to the implementor, it can indeed be tricky to find out what needs to be known, but it is not as difficult as you might think, since on many machines the official ABI settles many problems. In the case of GNU C, bug reports over the years have corrected all the remaining minor discrepancies that have been discovered (remember I said it was considered a bug if there are any discrepancies). This indeed means that a lot of the critical work was already in place to meet the GNAT requirement, but the requirement for GNAT is very definitely that it must be compatible with the standard vendor C compiler (as well as GNU C).