comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: Best representation for spares
Date: Fri, 14 Feb 2014 09:19:20 +0000
Date: 2014-02-14T09:19:20+00:00	[thread overview]
Message-ID: <lyvbwicaqv.fsf@pushface.org> (raw)
In-Reply-To: 215f6df2-a7ec-42f4-ac82-656d5b12bf61@googlegroups.com

"Rego, P." <pvrego@gmail.com> writes:

> using this kind of definitions, the compiler warns (correctly) me
>    warning: 29-bit gap before component "AUX_ENABLES"

I'd much prefer to fill this space. And, on the whole, better with zeros
(unless, of course, 'unused' means 'don't even write to this bit').

Something like

   type Zero_Bit is range 0 .. 0;
   type Zero_Bits is array (Positive range <>) of Zero_Bit;
   for Zero_Bits'Component_Size use 1;

   type Auxiliary_Interrupt_Status_Type is
      record
         Mini_Uart_IRQ : Boolean;
         SPI_1_IRQ     : Boolean;
         SPI_2_IRQ     : Boolean;
         Spare         : Zero_Bits (3 .. 31);
      end record;
   pragma Pack (Auxiliary_Interrupt_Status_Type);
   for Auxiliary_Interrupt_Status_Type'Size use 32;


  reply	other threads:[~2014-02-14  9:19 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-14  1:07 Best representation for spares Rego, P.
2014-02-14  9:19 ` Simon Wright [this message]
2014-02-15 16:06   ` Rego, P.
2014-02-15 17:49     ` Jeffrey Carter
2014-02-15 20:21       ` Rego, P.
2014-02-15 19:55     ` Niklas Holsti
2014-02-15 20:25       ` Rego, P.
2014-02-15 21:35         ` Rego, P.
2014-02-16 10:02           ` Niklas Holsti
2014-02-16 13:40             ` Rego, P.
2014-02-16 16:26               ` Rego, P.
2014-02-16 18:50                 ` Niklas Holsti
2014-02-16 16:33               ` Niklas Holsti
2014-02-16 12:10           ` Simon Wright
2014-02-16 13:43             ` Rego, P.
2014-02-16 14:25               ` Robert A Duff
2014-02-16 16:21                 ` Rego, P.
2014-02-15 21:41         ` Jeffrey Carter
2014-02-15 22:37           ` Rego, P.
2014-02-15 22:41             ` Rego, P.
2014-02-16  0:39             ` Jeffrey Carter
2014-02-16 12:06         ` Simon Wright
2014-02-16 13:45           ` Rego, P.
replies disabled

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