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=-0.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,9e499c74312ed3f0 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-05-17 12:29:46 PST Path: archiver1.sj.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!193.251.151.101!opentransit.net!wanadoo.fr!isdnet!psinet-france!psiuk-f4!psiuk-p4!uknet!psiuk-n!news.pace.co.uk!nh.pace.co.uk!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: Static assertions Date: Thu, 17 May 2001 15:09:28 -0400 Organization: Posted on a server owned by Pace Micro Technology plc Message-ID: <9e17la$km6$1@nh.pace.co.uk> References: <9e0pfb$ao9$1@s1.read.news.oleane.net> <3B040DE4.468E779F@boeing.com> NNTP-Posting-Host: 136.170.200.133 X-Trace: nh.pace.co.uk 990126570 21190 136.170.200.133 (17 May 2001 19:09:30 GMT) X-Complaints-To: newsmaster@pace.co.uk NNTP-Posting-Date: 17 May 2001 19:09:30 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.sj.google.com comp.lang.ada:7623 Date: 2001-05-17T19:09:30+00:00 List-Id: You have to be careful of the declarations. Just because you maybe did something to declare (for example) a 16 bit integer type, doesn't mean that 'Size for the type won't end up as 32. Even if you use a rep clause, the compiler doesn't have to honor it - although one would hope it was at least polite enough to inform you of that fact. Perhaps you could post the code you created to test it? MDC -- Marin David Condic Senior Software Engineer Pace Micro Technology Americas www.pacemicro.com Enabling the digital revolution e-Mail: marin.condic@pacemicro.com Web: http://www.mcondic.com/ "Jeffrey Carter" wrote in message news:3B040DE4.468E779F@boeing.com... > Jean-Pierre Rosen wrote: > > > > package Verifier is > > subtype Assert is Boolean range True..True; > > > > Assert_1 : constant := Boolean'Pos( Assert (Integer'Size=32) ); > > Assert_2 : constant := Boolean'Pos( Assert > > (Integer'Size=4*Character'Size) ); > > end Verifier; > > > > (The Boolean'Pos serves to have a value used in a named number declaration, > > which requires a static context). > > Interesting. However, Rational Apex 2.4.6 on HP compiles this fine even > if the declarations are changed to make the expressions false. A test > program to output the values of Assert_X produces 2 zeros. > > If I change the declarations to > > Assert_1 : constant Assert := Integer'Size = 73; > > then the unit will not compile. > > -- > Jeffrey Carter