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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c7ba3a3c7efe3bd X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!q40g2000prh.googlegroups.com!not-for-mail From: Edward Fish Newsgroups: comp.lang.ada Subject: Re: Adress => Access: types for unchecked conversion have different sizes Date: Sat, 12 Mar 2011 09:00:55 -0800 (PST) Organization: http://groups.google.com Message-ID: <20b96aee-9b0f-487e-926c-922209965d33@q40g2000prh.googlegroups.com> References: NNTP-Posting-Host: 174.28.182.16 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1299949256 18823 127.0.0.1 (12 Mar 2011 17:00:56 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sat, 12 Mar 2011 17:00:56 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: q40g2000prh.googlegroups.com; posting-host=174.28.182.16; posting-account=IGEw6QoAAAChe8btAoGmJk0kqF3q3VLA User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.15) Gecko/20110303 Firefox/3.6.15 ( .NET CLR 3.5.30729; .NET4.0E),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:18109 Date: 2011-03-12T09:00:55-08:00 List-Id: On Mar 12, 8:08=A0am, "Martin Krischik" wrote: > Hello, > > I currently have another go at building GNAT for MAx OS X. the current = =A0 > error message I am looking at is: > > {{{ > /Volumes/Daten/Developer/MacPorts/dports/lang/gnat-gcc/work/build/./gcc/x= gcc =A0 > -B/Volumes/Daten/Developer/MacPorts/dports/lang/gnat-gcc/work/build/./gcc= / =A0 > -B/opt/local/x86_64-apple-darwin10/bin/ =A0 > -B/opt/local/x86_64-apple-darwin10/lib/ -isystem =A0 > /opt/local/x86_64-apple-darwin10/include -isystem =A0 > /opt/local/x86_64-apple-darwin10/sys-include =A0 =A0-c -g -O2 -m32 -fPIC = =A0 > -pipe =A0-W -Wall -gnatpg -m32 =A0a-direct.adb -o a-direct.o > a-direct.adb:676:13: warning: types for unchecked conversion have =A0 > different sizes > > }}} > > The code in question is: > > {{{ > =A0 =A0 =A0 =A0 =A0 declare > =A0 =A0 =A0 =A0 =A0 =A0 =A0subtype Path_String is String (1 .. Filename_L= en); > =A0 =A0 =A0 =A0 =A0 =A0 =A0type =A0 =A0Path_String_Access is access Path_= String; > > =A0 =A0 =A0 =A0 =A0 =A0 =A0function Address_To_Access is new > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Ada.Unchecked_Conversion > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0(Source =3D> Address, > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Target =3D> Path_String_Access); > > =A0 =A0 =A0 =A0 =A0 =A0 =A0Path_Access : constant Path_String_Access :=3D > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0Address_To_Acc= ess (Filename_Addr); > > =A0 =A0 =A0 =A0 =A0 begin > =A0 =A0 =A0 =A0 =A0 =A0 =A0Last :=3D Filename_Len; > =A0 =A0 =A0 =A0 =A0 =A0 =A0Name (1 .. Last) :=3D Path_Access.all; > =A0 =A0 =A0 =A0 =A0 end; > > }}} > > Strange. Anybody got an idea what went wrong here? > > And I wonder if some `for Address use` magic would not be more appropriat= e =A0 > here. > > Regards > > Martin > -- > Martin Krischik > mailto://krisc...@users.sourceforge.nethttps://sourceforge.net/users/kris= chik You could try adding ALL to Path_String_Access; IIRC Access w/o the ALL is a fat-pointer (keeping info about the object) whereas the Access ALL is a thin- pointer (an address) in GNAT.