comp.lang.ada
 help / color / mirror / Atom feed
From: "Beard, Frank Randolph CIV" <frank.beard@navy.mil>
To: "comp.lang.ada mail to news gateway" <comp.lang.ada@ada.eu.org>
Subject: RE: pragma Import with 'Address clause
Date: Wed, 19 Mar 2003 11:59:21 -0500
Date: 2003-03-19T11:59:21-05:00	[thread overview]
Message-ID: <mailman.1.1048093197.743.comp.lang.ada@ada.eu.org> (raw)

> The Pragma Import should not be needed.

Shouldn't be needed but isn't guaranteed.  The Pragma Import is
there to ensure the compiler doesn't initialize the data.  There
is no guarantee that the compiler won't initialize it to
something, despite the fact the data structure doesn't have a
default expression.

When we were on VAX Ada, it seemed to initialize everything within
the range of the type.  The Alsys Ada, and I think the early versions
of Aonix, we used initialized integers to zero, booleans to FALSE,
etc.  The current version of Aonix does not do the initialization.
We ran into a problem once when upgrading the Aonix compiler.  Code
that used to work began raising CONSTRAINT_ERROR on uninitialized
variables in various places.  I always initialize everything, but
we were working with a team that was new to Ada and weren't 
experienced enough to value the practice.

So, it is better to use the pragma to guarantee the result rather
than hope it always works.  Your compiler vendor may change 
something some day and then your code will suddenly cease to run
properly.

Frank




             reply	other threads:[~2003-03-19 16:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-19 16:59 Beard, Frank Randolph CIV [this message]
2003-03-19 21:03 ` pragma Import with 'Address clause Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2003-03-19 14:12 Lutz Donnerhacke
2003-03-19 15:17 ` B0966864
2003-03-19 16:51 ` Stephen Leake
2003-03-19 17:10   ` Lutz Donnerhacke
2003-03-19 22:29     ` Rod Chapman
2003-03-21 11:13       ` Lutz Donnerhacke
2003-03-19 18:07 ` Rod Chapman
2003-03-21 11:31   ` Lutz Donnerhacke
replies disabled

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