comp.lang.ada
 help / color / mirror / Atom feed
From: "Martin Krischik" <krischik@users.sourceforge.net>
Subject: Adress => Access: types for unchecked conversion have different sizes
Date: Sat, 12 Mar 2011 16:08:06 +0100
Date: 2011-03-12T16:08:06+01:00	[thread overview]
Message-ID: <op.vr8kbsndz25lew@macpro-eth1.krischik.com> (raw)

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://krischik@users.sourceforge.net
https://sourceforge.net/users/krischik



             reply	other threads:[~2011-03-12 15:08 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-12 15:08 Martin Krischik [this message]
2011-03-12 17:00 ` Adress => Access: types for unchecked conversion have different sizes Edward Fish
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