comp.lang.ada
 help / color / mirror / Atom feed
From: Jeffrey Creem <jeff@thecreems.com>
Subject: Re: Porting problems from Solaris to Redhat Linux using GNAT 5.01a on both.
Date: Tue, 19 Jun 2007 22:19:53 -0400
Date: 2007-06-19T22:19:53-04:00	[thread overview]
Message-ID: <affmk4-7nc.ln1@newserver.thecreems.com> (raw)
In-Reply-To: <1182250537.808196.165460@n60g2000hse.googlegroups.com>

petter_fryklund@hotmail.com wrote:
> On 19 Juni, 12:27, "Alex R. Mosteo" <devn...@mailinator.com> wrote:
>>  petter_frykl...@hotmail.com wrote:
>>> First we got circularity detected in elaboration for a rather complex
>>> generic structure. This does not happen in Solaris. A pragma Suppress
>>> (Elaboration_Check) allowed us to build. But elaboration never
>>> completes. We suspect that a PROGRAM_ERROR has been raise, but see no
>>> trace of it. Last entry of call stack is an instantiation of generic
>>> package that needed pragma Suppress to build.
>>> Task Display does not work, always empty.
>>> Any suggestions?
>> Have you tried the -gnatE switch? Elaboration checks by gnat default to a
>> static, more restricted mechanism than required. It helped me in the past,
>> although nowadays I prefer to make my programs buildable without this
>> switch.
> 
> Thanks for the swift response.
> 
> Yes, it did not help at all. But perhaps the combination of pragma
> Suppress and -gnatE? Unfortunatly this is a big application depending
> on a large infrastructure set using complex generics. I don't
> understand why it differs between Solaris and Linux, but perhaps same
> release level is just an illusion.

> /Petter
> 

I know you eventually indicated you used the correct compiler version 
and things worked but suppressing elaboration checks or general pragma 
suppresses being required to make something work is a very good 
indication that you have broken code that even if it appears to 
elaborate is probably not doing what you expect it to be doing.

The combination of this followed by the "pragma pack seemed to work on 
one platform" argument sounds like a pretty broken software process.

While it may be true that any sufficiently large project ends up with 
non-ideal and or non-portable code in places, there seems to be a lot 
going on here that is just begging for trouble.


 From the LRM:

13.2 Pragma Pack

     If a type is packed, then the implementation should try to minimize 
storage allocated to objects of the type, possibly at the expense of 
speed of accessing components, subject to reasonable complexity in 
addressing calculations.
(7)
     The recommended level of support for pragma Pack is:
(8)

         * For a packed record type, the components should be packed as 
tightly as possible subject to the Sizes of the component subtypes, and 
subject to any record_representation_clause that applies to the type; 
the implementation may, but need not, reorder components or cross 
aligned word boundaries to improve the packing. A component whose Size 
is greater than the word size may be allocated an integral number of words.

(9)

         * For a packed array type, if the component subtype's Size is 
less than or equal to the word size, and Component_Size is not specified 
for the type, Component_Size should be less than or equal to the Size of 
the component subtype, rounded up to the nearest factor of the word size.



  parent reply	other threads:[~2007-06-20  2:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-19  8:56 Porting problems from Solaris to Redhat Linux using GNAT 5.01a on both petter_fryklund
2007-06-19 10:27 ` Alex R. Mosteo
2007-06-19 10:55   ` petter_fryklund
2007-06-19 13:02     ` petter_fryklund
2007-06-20  2:19     ` Jeffrey Creem [this message]
2007-06-20  6:41       ` petter_fryklund
replies disabled

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