Pragma Import don't suppress intialization on access type with GNAT 3.14p 
Author Message
 Pragma Import don't suppress intialization on access type with GNAT 3.14p


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 ?


Tue, 15 Mar 2005 16:58:41 GMT  
 [ 1 post ] 

 Relevant Pages 

1. Pragma Import don't suppress access initialization

2. GNAT pragma IMPORT and type conversions

3. pragma import problem ( also OS/2 : gnat 4emx )

4. Pragma Import on arrays in record types

5. pragma DEBUG and pragma ASSERT in gnat

6. Don't suppress the ODISC4 programming language survey

7. pragma Import with 'Address clause

8. gnat pragma's

9. GNAT DOS vs. GNAT NT: Pragma Suppress?

10. circular imports (don't yell!)

11. Accessing one's main script's global from imported libraries

12. problem solved, but I don't know why (was: GNAT implementation bug)


Powered by phpBB® Forum Software