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-Thread: a07f3367d7,ae8b13d4d815893c X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!c7g2000prc.googlegroups.com!not-for-mail From: Adam Beneschan Newsgroups: comp.lang.ada Subject: Re: (Num_Types.Mod_4 range 1..8) ------->why not (1..8)? Date: Tue, 19 May 2009 10:53:06 -0700 (PDT) Organization: http://groups.google.com Message-ID: <97b27e45-4ffd-4ab8-b0f8-0d20b520d3f1@c7g2000prc.googlegroups.com> References: <0571282b-0ab8-4eee-941f-e9369f5b4518@x6g2000vbg.googlegroups.com> <4a11b8cb$0$32680$9b4e6d93@newsspool2.arcor-online.net> <6b5fe400-2564-4fc9-a5bf-f83d1e476345@q14g2000vbn.googlegroups.com> <4a11cae4$0$32667$9b4e6d93@newsspool2.arcor-online.net> <03cb75a1-3458-420e-9871-6f64f784c177@s38g2000prg.googlegroups.com> NNTP-Posting-Host: 66.126.103.122 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1242755587 28273 127.0.0.1 (19 May 2009 17:53:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 19 May 2009 17:53:07 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c7g2000prc.googlegroups.com; posting-host=66.126.103.122; posting-account=duW0ogkAAABjRdnxgLGXDfna0Gc6XqmQ User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; WOW64; SLCC1; .NET CLR 2.0.50727; Media Center PC 5.0; .NET CLR 3.5.21022; .NET CLR 3.5.30729; .NET CLR 3.0.30618),gzip(gfe),gzip(gfe) Xref: g2news2.google.com comp.lang.ada:5944 Date: 2009-05-19T10:53:06-07:00 List-Id: On May 18, 11:26=A0pm, christoph.gr...@eurocopter.com wrote: > While re-hosting some code, yesterday I bumped into some code like so: > > =A0 type Some_Array is array (Some_Index range <>) of Some_Type; > =A0 subtype Small_Array is Some_Array (1 .. 8); > =A0 subtype Max_Array =A0 is Some_Array (1 .. Some_Index'Last); > > =A0 function Convert is Unchecked_Conversion (Source =3D> Small_Array, > Target =3D> Max_Array); > > Guess what the perpetrator told me was the reason for this > abomination: The compiler complained when he assigned an object of > Small_Array to one of Max_Array. So he found this "solution"... Sounds like things should have been set up to use GNAT's -- nouncwoiqtest flag. This forces the compiler to reject all uses of Unchecked_Conversion unless the programmer is known to have passed an IQ test. Well, if GNAT doesn't have that flag, it should. -- Adam