comp.lang.ada
 help / color / mirror / Atom feed
From: dch@st-vincent (David Haslam)
Subject: 'size works for SunAda but not GNAT
Date: 1996/10/08
Date: 1996-10-08T00:00:00+00:00	[thread overview]
Message-ID: <53dv03$3ti@gcsin3.geccs.gecm.com> (raw)


I have a lot of code like this, which compiles fine
with SunAda 1.1:

	subtype V is integer range 0..63;
	type A is array (1..9) of V;
	for A'size use 9 * 8;

GNAT complains "size for A must be at least 288".
GNAT wants V to be 32 bits, even though it can fit in 8.

If GNAT is correct in rejecting this, then it implies that the
code we have is non-portable (and relied on a Verdix implementation
dependent feature).
If so, how do I write portable rep clauses?
There are two ways of fixing the code for GNAT:
1. use a type instead of a subtype
2. add the line: "for A'component_size use 8;"

Which of these is better?

--
David Haslam                                 Work: David.Haslam@gecm.com
GEC-Marconi S3I Ltd                         Home: dch@sirius.demon.co.uk
Simulation and Training Division    




             reply	other threads:[~1996-10-08  0:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1996-10-08  0:00 David Haslam [this message]
1996-10-09  0:00 ` 'size works for SunAda but not GNAT Robert Dewar
1996-10-09  0:00 ` Stephen Leake
1996-10-11  0:00 ` Alan Brain
1996-10-11  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