This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR 23046. Folding predicates involving TYPE_MAX_VALUE/TYPE_MIN_VALUE(Ada RFC)


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




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]