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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: Stephen Leake Subject: Re: Urgent question: malloc and ada...READ/NEW/FOLLOWUP Date: 1998/04/27 Message-ID: <3544C257.29F3@gsfc.nasa.gov>#1/1 X-Deja-AN: 348151328 Content-Transfer-Encoding: 7bit References: <352A79C2.15FB7483@nathan.gmd.de> <1998Apr10.073110.1@eisner> <6hvm8k$t3l$1@news.hal-pc.org> <1998Apr26.172910.1@eisner> Content-Type: text/plain; charset=us-ascii Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA Mime-Version: 1.0 Reply-To: stephen.leake@gsfc.nasa.gov Newsgroups: comp.lang.ada Date: 1998-04-27T00:00:00+00:00 List-Id: Larry Kilgallen wrote: > > In article , Simon Wright writes: > > Jonathan Guthrie writes: > > > >> How does the Ada compiler implemetor know what C compiler is used in > >> that "particular environment in which the compiler operates"? > >> Telepathy? > > > > Well, one solution would be for the Ada vendor to specify it! In fact, > > given the need to match the C representations, I think the Ada vendor > > would have to. > > And, depending on the compiler one might have to specify particular > compilation modes for which the alignment characteristics will be > matched. I don't remember the details, but DEC C for Alpha allows > one to generate code which naturally aligns elements on quadword > boundaries or longword boundaries, depending on application needs. Borland C on Windows/Intel has a similar option, and it bit me once. I compiled my code with longword alignment (for floating point speed), but the Borland libraries were compiled with byte alignment. Bingo; system crash. So you don't even need inter-language complications to get bugs like this! It would be nice if the object files included this kind of information, so it could be checked at link time; anyone know if any object formats do? On the original topic, the Ada vendor must specify which C compiler(s) they support on the target of interest. This was true for Ada 83, and is still true for Ada 95. On the other hand, most CPUs I've used have a standard calling convention, so there isn't that much variation between compilers. Intel seems to be an exception; are there really other CPUs that have incompatible C compilers? -- Stephe