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,90f687f65a66617e X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Simple ADA/C Question Date: 1997/03/06 Message-ID: #1/1 X-Deja-AN: 223689885 References: <01bc23b2$ecc64960$64e2b8cd@p5120.bda> <331c6ca7.792732@news.demon.co.uk> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-03-06T00:00:00+00:00 List-Id: Keith said <> Maybe, but my form is guaranteed to give an error message, the assert form is not even guaranteed to give a warning (which would in any csae be overlooked if warnings were suppressed) <> No point in encouraging the (I think unwarranted) viewpoint that the rules about static expressions are complex by unnecessary concessions to some imagined confusion. 1 / 0 is an illegal expression. It is illegal quite independent of the context in which it occurs, and Ada 95 programmers should understand this point clearly! <> Check_Int_Size : Compile_Time_Assert := Require / (int'size = Integer'Size); <> Of course not! Arguing that you can sometimes use X instead of Y has nothing to do with arguing that Y should never be used! <> If you are writing a text book, or if you want to be really fanatical about being portable to arbitrary unknown compilers in the future (in practice, I suspect that a decision to make int /= Integer would break so much code that it might be quite unwise :-) P.S. All Aonix products have int'size = integer'size Note: Integer has a special place in Ada 95 because of its use in type String, so it is hard to get away from completely!