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,47bb539f07b52c30 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-15 15:56:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!newsfeed1.bredband.com!bredband!news.algonet.se!algonet!newspeer.clara.net!news.clara.net!btnet-peer!btnet-peer0!btnet!news5-gui.server.ntli.net!ntli.net!news2-win.server.ntlworld.com.POSTED!not-for-mail From: "martin.m.dowie" Newsgroups: comp.lang.ada References: <3bf3d68c$1@pull.gecm.com> <9t0mm9$hq8$1@s1.read.news.oleane.net> Subject: Re: How to get a compilation error X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: Date: Thu, 15 Nov 2001 23:49:34 -0000 NNTP-Posting-Host: 62.252.148.47 X-Complaints-To: abuse@ntlworld.com X-Trace: news2-win.server.ntlworld.com 1005868307 62.252.148.47 (Thu, 15 Nov 2001 23:51:47 GMT) NNTP-Posting-Date: Thu, 15 Nov 2001 23:51:47 GMT Organization: ntlworld News Service Xref: archiver1.google.com comp.lang.ada:16593 Date: 2001-11-15T23:49:34+00:00 List-Id: > > Could try: > > > > type A_Valid_Range is range 0 .. 0; > > > > My_Check : constant A_Valid_Range := > > A_Valid_Range (96 mod (Integer'Min (32, System.Max_Binary_Modulus / > > 2))); > > > > This will probably raise a warning rather than an error though. > > Some compilers will let you specify that warning are to be > > treated as errors. > 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). Ooohhh! That's good!!! Don't you just love this language!