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: jsa@alexandria (Jon S Anthony) Subject: Re: Simple ADA/C Question Date: 1997/03/05 Message-ID: #1/1 X-Deja-AN: 223577383 Distribution: world References: Organization: PSI Public Usenet Link Newsgroups: comp.lang.ada Date: 1997-03-05T00:00:00+00:00 List-Id: In article dewar@merv.cs.nyu.edu (Robert Dewar) writes: > Keith suggests > > << subtype Assertion is Boolean range True .. True; > Integer_Same_Size : constant Assertion > := Interfaces.C.int'Size = Standard.Integer'Size; > >> > > Less writing, and guaranteed to not merely give a warning, but to be > illegal if the assumption is violated is: You at compile time - surely at runtime (assuming no pragma supress or some such) this will raise CE if violated. > > X : Integer := 1 / Boolean'Pos (Interfaces.C.int'Size = Integer'Size); OK. But it is significantly less clear as well. > As for Keith's guess that there could be C compilers that disagree on > int size, I doubt it. Keith are you aware of all the discussions going > on around C sizes on 64-bit machines? This certainly _was_ a problem a few years ago. In a previous existence, I had to deal with it in a port to AlphaAXP. > compilers too. There is a danger of excessive pedantry here, and I suspect > Keith is worrying about something that in fact will not be a problem in I'm with Keith. /Jon -- Jon Anthony Organon Motives, Inc. Belmont, MA 02178 617.484.3383 jsa@organon.com