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: 103376,91b14dfe22ec5b78 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!newsfeed.mathworks.com!news-out.cwix.com!newsfeed.cwix.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!cyclone-sf.pbi.net!151.164.30.34!cyclone.swbell.net!bos-service1.raytheon.com!dfw-service2.ext.ray.com.POSTED!53ab2750!not-for-mail From: Mark H Johnson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Signed vs Natural/32-bits vs 31 bits References: <35f054ea.0410250743.45a14771@posting.google.com> In-Reply-To: <35f054ea.0410250743.45a14771@posting.google.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 25 Oct 2004 14:57:04 -0500 NNTP-Posting-Host: 192.27.48.106 X-Complaints-To: news@ext.ray.com X-Trace: dfw-service2.ext.ray.com 1098734225 192.27.48.106 (Mon, 25 Oct 2004 14:57:05 CDT) NNTP-Posting-Date: Mon, 25 Oct 2004 14:57:05 CDT Organization: Raytheon Company Xref: g2news1.google.com comp.lang.ada:5696 Date: 2004-10-25T14:57:04-05:00 List-Id: skidmarks wrote: > I'm using gcc under Cygwin and gcc with Mingw and am getting the > following warning: > > 476. function D_Datum is new Unchecked_Conversion(Datum_Type, > AIL_List.Datum_Type); > | > >>> warning: types for unchecked conversion have different sizes > >>> warning: size of "DATUM_TYPE" is 32, size of "DATUM_TYPE" is > 31 > >>> warning: 1 trailing bits of source will be ignored > > I understand what the message means but what is the operational > effect? What does 'ignored' mean in this context? To answer the specific question, "ignored" means "ignored". I should really go look at my notes but if I recall, GNAT (or the newer GCC's) doing unchecked conversion will do something like... - ignore unused bits, value will be truncated - source value will be extended with unspecified bits - sign extend - zero extend depending on the conditions when the number of source / destination bits do not match. These conditions basically are (in the same order...) - destination size < source size - destination size > source size & not a number - destination size > source size & a signed number - destination size > source size & an unsigned number I generally consider a warning like this to be an error instead and fix the offending code. Your subject (and not the body) makes me curious, why do you need an Unchecked_Conversion between signed and natural numbers? Is there something wrong with doing a type cast or is there something else involved? --Mark