comp.lang.ada
 help / color / mirror / Atom feed
From: Edward Fish <edward.r.fish@gmail.com>
Subject: Re: Adress => Access: types for unchecked conversion have different sizes
Date: Sat, 12 Mar 2011 09:00:55 -0800 (PST)
Date: 2011-03-12T09:00:55-08:00	[thread overview]
Message-ID: <20b96aee-9b0f-487e-926c-922209965d33@q40g2000prh.googlegroups.com> (raw)
In-Reply-To: op.vr8kbsndz25lew@macpro-eth1.krischik.com

On Mar 12, 8:08 am, "Martin Krischik" <krisc...@users.sourceforge.net>
wrote:
> Hello,
>
> I currently have another go at building GNAT for MAx OS X. the current  
> error message I am looking at is:
>
> {{{
> /Volumes/Daten/Developer/MacPorts/dports/lang/gnat-gcc/work/build/./gcc/xgcc  
> -B/Volumes/Daten/Developer/MacPorts/dports/lang/gnat-gcc/work/build/./gcc/  
> -B/opt/local/x86_64-apple-darwin10/bin/  
> -B/opt/local/x86_64-apple-darwin10/lib/ -isystem  
> /opt/local/x86_64-apple-darwin10/include -isystem  
> /opt/local/x86_64-apple-darwin10/sys-include    -c -g -O2 -m32 -fPIC  
> -pipe  -W -Wall -gnatpg -m32  a-direct.adb -o a-direct.o
> a-direct.adb:676:13: warning: types for unchecked conversion have  
> different sizes
>
> }}}
>
> The code in question is:
>
> {{{
>           declare
>              subtype Path_String is String (1 .. Filename_Len);
>              type    Path_String_Access is access Path_String;
>
>              function Address_To_Access is new
>                Ada.Unchecked_Conversion
>                  (Source => Address,
>                   Target => Path_String_Access);
>
>              Path_Access : constant Path_String_Access :=
>                              Address_To_Access (Filename_Addr);
>
>           begin
>              Last := Filename_Len;
>              Name (1 .. Last) := Path_Access.all;
>           end;
>
> }}}
>
> Strange. Anybody got an idea what went wrong here?
>
> And I wonder if some `for Address use` magic would not be more appropriate  
> here.
>
> Regards
>
> Martin
> --
> Martin Krischik
> mailto://krisc...@users.sourceforge.nethttps://sourceforge.net/users/krischik

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.



  reply	other threads:[~2011-03-12 17:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-12 15:08 Adress => Access: types for unchecked conversion have different sizes Martin Krischik
2011-03-12 17:00 ` Edward Fish [this message]
2011-03-12 17:05 ` Simon Wright
2011-03-13  9:35   ` Martin Krischik
2011-03-13 11:57     ` Simon Wright
2011-03-13 13:03       ` Martin Krischik
2011-03-13  3:32 ` Randy Brukardt
2011-03-13  9:47   ` Martin Krischik
2011-03-13 23:16     ` Randy Brukardt
2011-03-14  7:26       ` Martin Krischik
2011-03-14 18:40         ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox