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.1 required=5.0 tests=BAYES_00,FREEMAIL_FROM, FREEMAIL_REPLYTO_END_DIGIT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,47bb539f07b52c30 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-16 02:02:19 PST From: Pi Subject: Re: How to get a compilation error Newsgroups: comp.lang.ada Reply-To: pi3_1415926536@yahoo.ca References: <3bf3d68c$1@pull.gecm.com> <9t0mm9$hq8$1@s1.read.news.oleane.net> <9t2i83$7j2$1@s1.read.news.oleane.net> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8Bit User-Agent: KNode/0.3.2 Message-ID: <8o5J7.21146$va4.3735578@news20.bellglobal.com> Date: Fri, 16 Nov 2001 05:22:34 -0500 NNTP-Posting-Host: 65.94.128.181 X-Complaints-To: abuse@sympatico.ca X-Trace: news20.bellglobal.com 1005904516 65.94.128.181 (Fri, 16 Nov 2001 04:55:16 EST) NNTP-Posting-Date: Fri, 16 Nov 2001 04:55:16 EST Organization: Bell Sympatico Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!sunqbc.risq.qc.ca!torn!webster!nf1.bellglobal.com!nf2.bellglobal.com!news20.bellglobal.com.POSTED!not-for-mail Xref: archiver1.google.com comp.lang.ada:16621 Date: 2001-11-16T05:22:34-05:00 List-Id: Jean-Pierre Rosen wrote : > > "Wilhelm Spickermann" a �crit dans le > message news: mailman.1005881899.15799.comp.lang.ada@ada.eu.org... > >> To get an error, do the following: > >> subtype Assert is boolean range True..True; > >> Check : constant := Assert'Pos(96 rem Chunk_Bits = 0) > >> > >> Since Check is a named number, an invalid value will result in > >> a compile time error (new in 95). > > > >Hmm, I didn�t get a compilation error with gnat and I think > >thats correct. 0 is a valid value for Check and False is a valid > >parameter for Assert�POS as it takes Assert�BASE parameters > >according to ARM 3.5.5(3). > That's right... try: > Check : constant := Assert'Pos(Assert(96 rem Chunk_Bits = 0)) > or Check : constant Boolean := Boolean'Pred(96 rem Chunk_Bits = 0); or Check : constant := Boolean'Pos(Boolean'Pred(96 rem Chunk_Bits = 0)); no need for an Assert-subtype ;-) Only that Check will always be false when it compiles. TMTOWTDI -- 3,14159265359