comp.lang.ada
 help / color / mirror / Atom feed
* Question about "for X'Size use ..."
@ 2001-08-09 17:02 Darren New
  2001-08-09 17:37 ` Florian Weimer
  2001-08-10 14:46 ` john mann
  0 siblings, 2 replies; 13+ messages in thread
From: Darren New @ 2001-08-09 17:02 UTC (permalink / raw)



Let's say I declare
  type Blah is mod 2**12;
  for Blah'Size use 12;

Does that "for use" clause actually do anything? I.e., what does that
really mean on a CPU with 8-bit bytes? It doesn't change the size of
registers. Does it affect how things are written to streams?

I understand that if I pack an array or record or whatever, it makes a
difference. But is the compiler going to generate different code if a
Blah never winds up in an array or record or whatever? Will it be stored
in (say) a 16-bit location where it might be more efficient to use a
full 32 bits?

What if I say
  type Blah is mod 2**12;
  for Blah'Size use 64;
Does this have any effect? Is any compiler going to refuse to compile
those statements because it only has 32-bit registers?

TIA!

-- 
Darren New / Senior MTS & Free Radical / Invisible Worlds Inc.
San Diego, CA, USA (PST). Cryptokeys on demand. dnew@san.rr.com
"You probably noticed you can't breath underwater. Hence the tank."
   -- PADI instruction manual, page 107.



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

end of thread, other threads:[~2001-08-10 21:43 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-09 17:02 Question about "for X'Size use ..." Darren New
2001-08-09 17:37 ` Florian Weimer
2001-08-09 22:39   ` Robert Dewar
2001-08-10  8:46     ` Florian Weimer
2001-08-10 10:36       ` Larry Kilgallen
2001-08-10 13:15         ` Question about Ted Dennison
2001-08-10 13:54           ` Larry Kilgallen
2001-08-10 17:09         ` Question about "for X'Size use ..." Robert Dewar
2001-08-10 17:11       ` Robert Dewar
2001-08-10 20:25         ` Florian Weimer
2001-08-10 21:43           ` Larry Kilgallen
2001-08-10 20:58             ` Toshitaka KUMANO
2001-08-10 14:46 ` john mann

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