comp.lang.ada
 help / color / mirror / Atom feed
From: dewar@cs.nyu.edu (Robert Dewar)
Subject: Re: How to print Task_ID type? (GNAT SunOS)
Date: 1996/04/06
Date: 1996-04-06T00:00:00+00:00	[thread overview]
Message-ID: <dewar.828789454@schonberg> (raw)
In-Reply-To: 4k50tc$7ge@mulga.cs.mu.OZ.AU

Fergus says

"This is because the C standard allows implementations to represent different
pointer types differently."

That's true, but in practice very rarely taken advantage of.

The Ada standard permits this too of course, and GNAT does take advantage
of this (using double width pointers for pointers to unconstrained
arrays).

It is surprising how MUCH Ada code out there relies on the assumption
that all pointers are the same size as addresses. n fact we ran into this
so often in GNAT, that now GNAT allows you to specify the size of an
access type, and force this to be true if you want it, e.g.

    type g is access string;
    for g'size use address'size;

This representation is less time efficient but lots of existing Ada code
had this assumption deeply built in.





      reply	other threads:[~1996-04-06  0:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-04-03  0:00 How to print Task_ID type? (GNAT SunOS) Greg Bond
1996-04-04  0:00 ` Robert Dewar
1996-04-04  0:00   ` Greg Bond
1996-04-04  0:00   ` Greg Bond
1996-04-05  0:00     ` Robert Dewar
1996-04-05  0:00     ` Keith Thompson
1996-04-05  0:00       ` Greg Bond
1996-04-05  0:00       ` Robert Dewar
1996-04-06  0:00         ` Keith Thompson
1996-04-06  0:00           ` Robert Dewar
1996-04-07  0:00           ` Keith Thompson
1996-04-05  0:00   ` Laurent Guerby
1996-04-04  0:00     ` Joel Sherrill
1996-04-06  0:00       ` Fergus Henderson
1996-04-06  0:00         ` Robert Dewar [this message]
replies disabled

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