Richard Kenner wrote:
> Well sure, reading an uninitialized value is erroneous except for the use
> of 'Valid.
No, it's not, as Ada is not C.
What's "not"? My statement is based on the Ada RM.
the rm is quite clear, lack of initialization
never leads to erroneous behavior. an uninitialized
variable may have an invalid value, but is not
abnormal. For example it is not a valid
implementation for
a(i) := 0;
to overwrite memory outside the array a when
i is uninitialized, a validity check is
required here. same thing with case
statements.
And please note the presence of pragma Normalize_Scalars.
That doesn't affect validity or erroneousness.
the progrm is not erroneous in either case