comp.lang.ada
 help / color / mirror / Atom feed
* Pragma Import don't suppress access initialization
@ 2002-10-07 12:10 Frédéric Ormancey
  2002-10-07 17:25 ` Matthew Heaney
  2002-10-07 17:25 ` Craig Carey
  0 siblings, 2 replies; 4+ messages in thread
From: Frédéric Ormancey @ 2002-10-07 12:10 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 a solution to avoid this value erasure ?

Thanks.



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2002-10-07 19:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-07 12:10 Pragma Import don't suppress access initialization Frédéric Ormancey
2002-10-07 17:25 ` Matthew Heaney
2002-10-07 19:49   ` Jeffrey Carter
2002-10-07 17:25 ` Craig Carey

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