From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,ae233931baf2d312,start X-Google-Attributes: gid103376,public From: "W. Wesley Groleau (Wes)" Subject: Re: Integer'Size < 32 ? Date: 1996/08/08 Message-ID: <9608081258.AA02749@most>#1/1 X-Deja-AN: 173071677 sender: Ada programming language comments: To: info-ada%listserv.nodak.edu@emcee.com mailer: Elm [revision: 70.85] newsgroups: comp.lang.ada Date: 1996-08-08T00:00:00+00:00 List-Id: There have been many good answers to the two questions about 16 bit integers (IMHO Dewar's was the clearest) but none of them mentioned one detail: One of the queries suggested that constraint_error would be raised if the compiler did not have a big enough predefined integer type. The truth is, if such a type is not supported, the compiler is supposed to refuse to compile the program. But I have a related question: many of the posts on the topic repeated the definition .... range -(2**31) .. ((2**31)-1) I once used a compiler for which Integer'Size = 32 and which had an interesting "feature." It recognized that the above would fit in 32 bits, so it compiled for that size. Then at run-time, it would (obeying the precedence rules) try to compute 2**31 and raise constraint_error. (I didn't use the parentheses, but that doesn't change the semantics.) The ugly work-around was .... range -2**31 .. 2**30 + (2**30 - 1); My question is, "Is this a common 'feature'?" (Since so many people have quoted the same example, I presume the answer is 'no') -- --------------------------------------------------------------------------- W. Wesley Groleau (Wes) Office: 219-429-4923 Hughes Defense Communications (MS 10-40) Home: 219-471-7206 Fort Wayne, IN 46808 (Unix): wwgrol@pseserv3.fw.hac.com ---------------------------------------------------------------------------