comp.lang.ada
 help / color / mirror / Atom feed
From: tmoran@acm.org
Subject: reserved fields; was Re: Interfacing with C ; an ununsed fields dilemma
Date: Thu, 2 Jul 2009 18:14:51 +0000 (UTC)
Date: 2009-07-02T18:14:51+00:00	[thread overview]
Message-ID: <h2iter$ba4$1@aioe.org> (raw)
In-Reply-To: bcd29aeb-57e6-4da7-bf30-d20717e98193@l12g2000yqo.googlegroups.com

> A lot of C structure are defined with so called unused field
> reserved for future use (oftenly never used in any future). This
> fields are generally to be initialized to zero, what is required, to
> unsure it will not be errorneously interpreted ...

  So such a field is not unused - it's currently a version field whose
value is zero, but in the future it may take non-zero values with
meanings other than version number, so "Version_Number" would not
be an appropriate name. "Reserved", or possibly "TBD", would be
appropriate names.

   type C_Rec is record
      I1       : Integer  := 0;
      Reserved : Integer range 0 .. 0 := 0;
      F1       : Float    := 0.0;
   end record;
   for C_Rec use record
      I1       at 0 range  0 .. 31;
      Reserved at 4 range 32 .. 63;
      F1       at 8 range 64 .. 95;
   end record;



  reply	other threads:[~2009-07-02 18:14 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-02  6:20 Interfacing with C ; an ununsed fields dilemma Hibou57 (Yannick Duchêne)
2009-07-02  9:25 ` Martin
2009-07-02 18:14   ` tmoran [this message]
2009-07-02  9:45 ` Maciej Sobczak
2009-07-02 12:01   ` Hibou57 (Yannick Duchêne)
2009-07-02 12:09     ` Georg Bauhaus
2009-07-02 13:21       ` Hibou57 (Yannick Duchêne)
2009-07-02 15:50         ` Georg Bauhaus
2009-07-02 14:52     ` Maciej Sobczak
2009-07-02 23:21       ` Hibou57 (Yannick Duchêne)
2009-07-03  7:21         ` Maciej Sobczak
2009-07-02  9:51 ` Georg Bauhaus
2009-07-02 10:16   ` Martin
2009-07-02 11:48     ` Hibou57 (Yannick Duchêne)
2009-07-02 15:55 ` Robert A Duff
2009-07-04  0:03   ` Randy Brukardt
2009-07-03  6:59 ` anon
replies disabled

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