comp.lang.ada
 help / color / mirror / Atom feed
* 'size works for SunAda but not GNAT
@ 1996-10-08  0:00 David Haslam
  1996-10-09  0:00 ` Stephen Leake
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: David Haslam @ 1996-10-08  0:00 UTC (permalink / 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    




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1996-10-11  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1996-10-08  0:00 'size works for SunAda but not GNAT David Haslam
1996-10-09  0:00 ` Stephen Leake
1996-10-09  0:00 ` Robert Dewar
1996-10-11  0:00 ` Alan Brain
1996-10-11  0:00   ` Robert Dewar

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