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.9 required=5.0 tests=BAYES_00 autolearn=ham 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 11:03:28 PST Newsgroups: comp.lang.ada Path: archiver1.sj.google.com!newsfeed.google.com!newsfeed.stanford.edu!news.tele.dk!144.212.100.101!newsfeed.mathworks.com!news.mathworks.com!uunet!ash.uu.net!xyzzy!nntp From: Jeffrey Carter Subject: Re: Static assertions X-Nntp-Posting-Host: e246420.msc.az.boeing.com Content-Type: text/plain; charset=us-ascii Message-ID: <3B040DE4.468E779F@boeing.com> Sender: nntp@news.boeing.com (Boeing NNTP News Access) Content-Transfer-Encoding: 7bit Organization: The Boeing Company X-Accept-Language: en References: <9e0pfb$ao9$1@s1.read.news.oleane.net> Mime-Version: 1.0 Date: Thu, 17 May 2001 17:44:04 GMT X-Mailer: Mozilla 4.5 [en]C-CCK-MCD Boeing Kit (WinNT; U) Xref: archiver1.sj.google.com comp.lang.ada:7622 Date: 2001-05-17T17:44:04+00:00 List-Id: 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