comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Simple ADA/C Question
Date: 1997/03/02
Date: 1997-03-02T00:00:00+00:00	[thread overview]
Message-ID: <dewar.857350486@merv> (raw)
In-Reply-To: E6BCJK.2LL@thomsoft.com


Keith said

<<If you have a C function that returns an int, the corresponding Ada
function's return type should be Interfaces.C.int.  Yes, C's int and Ada's
Integer are usually the same size, but why take chances when the language
provides a type that's *guaranteed* to have the same representation?>>

I understand that position, but the trade off is between piles of annoying
conversions and much more straightforward code in some instances.

However, this was not the issue, Bob said that using int on the C side
and Integer on the Ada side definitely *will* cause problems, and this
is plain wrong!

Are there any compilers incidentally where int in C is not the same
as Integer in Ada? Certainly int = Integer on all GNAT compilers.
Hard to believe that anyone would deviate from this equivalence. Given
that the choice of what Integer means in Ada is definitely implementation
dependent, it seems foolish to make any other choice.





  reply	other threads:[~1997-03-02  0:00 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-25  0:00 Simple ADA/C Question root
1997-02-26  0:00 ` Bob Klungle
1997-02-26  0:00   ` root
1997-02-26  0:00     ` Robert Dewar
1997-02-28  0:00       ` Keith Thompson
1997-03-02  0:00         ` Robert Dewar [this message]
1997-03-04  0:00           ` Keith Thompson
1997-03-04  0:00             ` Robert Dewar
1997-03-04  0:00               ` John McCabe
1997-03-04  0:00                 ` Anders Eliasson
1997-03-04  0:00                 ` Robert Dewar
1997-03-06  0:00                   ` Keith Thompson
1997-03-06  0:00                     ` Robert Dewar
1997-03-06  0:00                     ` Larry Kilgallen
1997-03-09  0:00                       ` Robert Dewar
1997-02-26  0:00     ` John McCabe
1997-02-26  0:00     ` Stephen Leake
1997-02-26  0:00       ` root
1997-02-27  0:00 ` Robert Dewar
1997-02-27  0:00   ` root
1997-02-27  0:00   ` root
1997-03-03  0:00 ` Robert I. Eachus
1997-03-05  0:00   ` Robert Dewar
1997-03-05  0:00 ` Jon S Anthony
1997-03-06  0:00   ` Robert Dewar
1997-03-07  0:00 ` Jon S Anthony
1997-03-07  0:00   ` Robert Dewar
1997-03-08  0:00     ` Larry Kilgallen
1997-03-07  0:00   ` Robert Dewar
replies disabled

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