comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@merv.cs.nyu.edu (Robert Dewar)
Subject: Re: Waiver question
Date: 1997/04/29
Date: 1997-04-29T00:00:00+00:00	[thread overview]
Message-ID: <dewar.862311272@merv> (raw)
In-Reply-To: m2zpui69zn.fsf@acm.org


Corey said

<<on the Alpha will print:
        1020304 0 0 0
and on the C40 will print:
        1 2 3 4
because on the C40 a char and an int are the same size because the
minimum size of any addressable unit is 32-bits.>>

Of course there is no requirement in C that you put a char in a single
32-bit word, you could perfectly well use a more compact representenation,
with a special form for the (char *) pointer (I believe the Cray C does
this -- rather than putting chars in 64 bits).

Of course it is simpler to put one character/32 bits, and if you make
this choice, (which is what I believe the 1750-A port for GNAT does,
one character per 16 bits), then things are relatively simple.

type String in Ada is packed, which means for example that you cannot
meaningfully get the address of individual elements in the string in
any case and remain portable (i.e. 'Address of two successive characters
in a string may well be the same). 

So it would be attractive to pack characters if you did a C30 GNAT port,
even if the C compiler did not, and it would fall out free, since this kind
of packing is done by the front end anyway in GNAT.





  parent reply	other threads:[~1997-04-29  0:00 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-04-18  0:00 Waiver question Ken Garlington
1997-04-19  0:00 ` Tom Moran
1997-04-20  0:00 ` Dean Runzel
1997-04-22  0:00   ` Ken Garlington
1997-04-20  0:00 ` Steve Doiel
1997-04-20  0:00 ` Robert Dewar
1997-04-21  0:00   ` Ken Garlington
1997-04-22  0:00     ` Ken Garlington
1997-04-23  0:00       ` Corey Minyard
1997-04-24  0:00         ` Richard Kenner
1997-04-28  0:00         ` Larry Kilgallen
1997-04-28  0:00           ` Corey Minyard
1997-04-29  0:00             ` Laurent Guerby
1997-04-30  0:00               ` Corey Minyard
1997-04-29  0:00             ` Kaz Kylheku
1997-04-29  0:00             ` Robert Dewar [this message]
1997-04-29  0:00           ` Richard Kenner
1997-04-30  0:00             ` Robert A Duff
1997-05-01  0:00               ` Kaz Kylheku
1997-05-02  0:00                 ` Robert A Duff
1997-05-02  0:00                   ` Larry Kilgallen
1997-05-02  0:00                     ` Robert Dewar
1997-05-02  0:00                     ` Robert A Duff
1997-05-02  0:00                       ` Larry Kilgallen
1997-05-03  0:00                         ` Robert A Duff
1997-05-03  0:00                           ` Larry Kilgallen
1997-05-04  0:00                             ` Robert Dewar
1997-05-04  0:00                         ` Robert Dewar
1997-05-06  0:00                     ` John M. Mills
1997-04-30  0:00             ` Robert Dewar
1997-05-01  0:00               ` Larry Kilgallen
1997-05-07  0:00                 ` Bad .diff files in gnat-3.09 in Linux Benoit Jauvin-Girard
1997-05-09  0:00                   ` Albert K. Lee
1997-04-29  0:00           ` Waiver question Robert Dewar
1997-04-23  0:00     ` Tarjei Jensen
1997-04-21  0:00 ` Robert I. Eachus
1997-04-21  0:00   ` Robert Dewar
1997-04-22  0:00     ` Robert I. Eachus
1997-04-23  0:00       ` Robert Dewar
1997-04-22  0:00   ` Ken Garlington
1997-04-23  0:00     ` Robert S. White
1997-04-24  0:00     ` Robert Dewar
1997-04-24  0:00       ` Steve Vestal
1997-04-25  0:00         ` Robert I. Eachus
1997-04-25  0:00         ` Ken Garlington
replies disabled

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