comp.lang.ada
 help / color / mirror / Atom feed
From: Jacob Sparre Andersen <sparre@nbi.dk>
Subject: Re: Zero_Fill pragma
Date: 20 Jul 2004 23:06:00 +0200
Date: 2004-07-20T23:06:00+02:00	[thread overview]
Message-ID: <plllhecrt3.fsf@sparre.crs4.it> (raw)
In-Reply-To: opsbgc51fxp4pfvb@bram-2

Nick Roberts wrote:

> The pragma is not intended to affect any of the bits that are used
> to represent a value. In a composite type, you sometimes get 'gaps'
> in between components (or possibly at the edges), of 'unused'
> bits. The pragma is intended to cause these unused bits to be
> initialised to 0 whenever the composite object as a whole is
> initialised. It is not intended to affect the initialisation (or
> reading or updating) of any of the components.
> 
> The purpose of the pragma is for use in interfacing, either with
> hardware or with data in any externally defined format.
> 
> It is quite often the case, when doing this, that a composite
> value has gaps which (according to the hardware design or data
> definition) must be kept 0.
> 
> Although this can be done explicitly using 'dummy' components, it is
> a pain doing so, and I think it can reduce the readability and
> maintainability of code. I think the suggested pragma would be
> better.

I disagree.

Although I can see that it is a bit of work to declare the parts of
the object that have to have a fixed value (it could also be 1 for
some hardware), but I still believe that it is better to do it
explicitly.

Jacob
-- 
"simply because no one had discovered a cure for the universe as a
 whole - or rather the only one that did exist had been abolished"



  reply	other threads:[~2004-07-20 21:06 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-20 16:22 Zero_Fill pragma Nick Roberts
2004-07-20 17:37 ` Jean-Pierre Rosen
2004-07-20 20:14   ` Nick Roberts
2004-07-20 21:06     ` Jacob Sparre Andersen [this message]
2004-07-20 22:15     ` Georg Bauhaus
2004-07-21  7:21     ` Jean-Pierre Rosen
2004-07-21  9:00     ` Martin Dowie
2004-07-20 21:57 ` Frank
  -- strict thread matches above, loose matches on Subject: below --
2004-07-20 17:13 Lionel.DRAGHI
2004-07-21 12:27 ` Marin David Condic
2004-07-22  9:02   ` Dale Stanbrough
2004-07-21  9:24 Lionel.DRAGHI
2004-07-21 12:59 Lionel.DRAGHI
2004-07-21 21:54 ` Marin David Condic
replies disabled

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