comp.lang.ada
 help / color / mirror / Atom feed
From: frederic.ormancey@atosorigin.com (Frédéric Ormancey)
Subject: Pragma Import don't suppress intialization on access type with GNAT 3.14p
Date: 27 Sep 2002 01:58:41 -0700
Date: 2002-09-27T08:58:41+00:00	[thread overview]
Message-ID: <9c9fb8b4.0209270058.698b0484@posting.google.com> (raw)

Hi,

I was using a 'Address to cast system.address type to an access type,
which work fine with GNAT 3.13 but cause an eroneous intialization and
erase my access value with NULL when compiled with GNAT 3.14p ( I'am
doing a migration from GNAT 3.13 to GNAT 3.14 ).

Code look like this :

   function Analyser_Formule (Varset : in System.ADDRESS) return
Integer is
     V : Ty_Varset;
     for V use at Varset;
     pragma Import (Ada, V);

where Ty_Varset is declared in another package :

    type Varset(Nature : Character; Taille : Integer);
    type Ty_Varset is access Varset;

I use the pragma Import to avoid the compiler warning : "implicit
initialization of V may modify overlaid storage, use pragma Import for
V to suppress initialization (RM B(24))" as describe in the GNAT_RM
documentation / Address_Clauses chapter.

Unfortunatly the implicit initialization of V erase the Varset
parameter of the fonction and force it to 0x0 value, and the pragma
Import clause has no effect :-(

Does anybody have ever seen the same problem with GNAT 3.14 ?

Thanks.



                 reply	other threads:[~2002-09-27  8:58 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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