comp.lang.ada
 help / color / mirror / Atom feed
From: mheaney@ni.net (Matthew Heaney)
Subject: Re: Ada 95 Numerics questions for the experts
Date: 1997/09/08
Date: 1997-09-08T00:00:00+00:00	[thread overview]
Message-ID: <mheaney-ya023680000809972030110001@news.ni.net> (raw)
In-Reply-To: EG7FA3.EKK@world.std.com


In article <EG7FA3.EKK@world.std.com>, bobduff@world.std.com (Robert A
Duff) wrote:


>Sorry, I should have clarified that my advice was stylistic.  It doesn't
>matter what the RM says -- stylistically, Pack means "minimize space,
>more or less", and "for T'Component_Size use N" means, "I want exactly
>N-bit components".  Surely Pack had that feeling in Ada 83, and the
>addition of requirements in Ada 95 was merely a response to
>implementations that failed to do *anything* to minimize space, so we
>had to specify *how much* (as a minimum) space has to be minimized.

Assume conformance to Annex C, and I compile this declaration:

type T is range 0 .. 7;
type A is array (Integer range 1 .. 10) of T;
for A'Component_Size use 3;

Yes or no: if the implementation doesn't support a component size of 3, can
it still compile this declaration, giving A some other component size?

From what Robert Dewar said, it seems that, if we interpret the RM
literally, one must also include a pragma Pack, in order to get the
compiler to reject the declaration (if it doesn't support a component size
of 3).

I ask because there might be a bug in the RM, and that the intentation of
the RM is that the compiler reject the declaration above, in spite of the
fact that there is no pragma Pack, if it doesn't support that component
size.

So, Bob Duff, writer of the RM, answer yes or no: is pragma Pack required
in the example above, in order to guarantee that the component size really
is 3?

--------------------------------------------------------------------
Matthew Heaney
Software Development Consultant
<mailto:matthew_heaney@acm.org>
(818) 985-1271




  reply	other threads:[~1997-09-08  0:00 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <3401C14B.480@gsfc.nasa.gov>
1997-08-25  0:00 ` Ada 95 Numerics questions for the experts Robert Dewar
     [not found] ` <dewar.872560585@merv>
     [not found]   ` <jcreem-2608970711210001@ljd155.sanders.lockheed.com>
     [not found]     ` <dewar.872630607@merv>
     [not found]       ` <jeffrey.m.creem-2708970802350001@ljd155.sanders.lockheed.com>
1997-08-27  0:00         ` Robert Dewar
     [not found]           ` <jeffrey.m.creem-2808970708260001@ljd155.sanders.lockheed.com>
1997-08-28  0:00             ` Robert Dewar
1997-08-27  0:00         ` David C. Hoos, Sr.
1997-08-27  0:00           ` Jeff Creem
1997-08-28  0:00             ` Robert Dewar
1997-08-28  0:00               ` Jeff Creem
1997-08-29  0:00               ` Tucker Taft
1997-08-30  0:00                 ` Robert A Duff
1997-08-31  0:00                 ` Tom Moran
1997-09-01  0:00                 ` Robert Dewar
1997-09-02  0:00                   ` Robert A Duff
1997-09-02  0:00                   ` Fergus Henderson
     [not found]                   ` <mheaney-ya023680000209972104030001@news.ni.net>
1997-09-05  0:00                     ` Robert Dewar
1997-09-05  0:00                       ` Matthew Heaney
1997-09-08  0:00                         ` Robert A Duff
1997-09-08  0:00                           ` Matthew Heaney
1997-09-09  0:00                             ` Robert A Duff
     [not found]                     ` <EFxt94.F5F@world.std.com>
1997-09-06  0:00                       ` Robert Dewar
1997-09-08  0:00                         ` Robert A Duff
1997-09-08  0:00                           ` Matthew Heaney [this message]
1997-09-09  0:00                             ` Robert A Duff
1997-09-01  0:00                 ` Robert Dewar
1997-08-27  0:00           ` Robert Dewar
1997-08-30  0:00         ` Robert A Duff
replies disabled

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