[comp.lang.ada] 'small not power of 2

westley@aardvark.uucp (Terry J. Westley) (03/23/90)

In article <EACHUS.90Mar21171727@aries.aries.mitre.org> eachus@aries.mitre.org (Robert I. Eachus) writes:
>      Huh? Why must 'SMALL be a power of two?  By default 'SMALL is a
>power of two, but this is an arbitrary choice which can be overridden
>by a "for foo'SMALL use ..." declaration.

Since confession is supposed to be good, I confess that this capability
had never penetrated the fog in my brain.  I know that I have read it
in Booch (_Software_Engineering_with_Ada_) and in the RM, but it never
clicked.  Thanks.

I tried your types METERS and NAUTICAL_MILES example from the referenced
article.  The compiler I used (Verdix 6.0 on Sun 4) generated code for
the conversion functions.  The compiler crashed when I used higher
levels of optimization.  (Note to anyone from Verdix who might be
reading this: I sent a report in today with the details.)
Unchecked_Conversion, of course, works.

Do you know of any compilers that are "smart" enough to detect this
situation?

Terry J. Westley
Arvin/Calspan Advanced Technology Center
P.O. Box 400, Buffalo, NY 14225
acsu.buffalo.edu!planck!hercules!westley