From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,ab43ecf7e1a10743 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!news.jgaa.com!news.hacking.dk!pnx.dk!munin.nbi.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Re: Zero_Fill pragma Date: 20 Jul 2004 23:06:00 +0200 Organization: Munin Sender: sparre@sparre.crs4.it Message-ID: References: NNTP-Posting-Host: 80.241.165.42 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: munin.nbi.dk 1090357561 1072 80.241.165.42 (20 Jul 2004 21:06:01 GMT) X-Complaints-To: sparre@munin.nbi.dk NNTP-Posting-Date: Tue, 20 Jul 2004 21:06:01 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: g2news1.google.com comp.lang.ada:2290 Date: 2004-07-20T23:06:00+02:00 List-Id: 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"