comp.lang.ada
 help / color / mirror / Atom feed
* Pragma Import don't suppress intialization on access type with GNAT 3.14p
@ 2002-09-27  8:58 Frédéric Ormancey
  0 siblings, 0 replies; only message in thread
From: Frédéric Ormancey @ 2002-09-27  8:58 UTC (permalink / 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.



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-09-27  8:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-09-27  8:58 Pragma Import don't suppress intialization on access type with GNAT 3.14p Frédéric Ormancey

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