comp.lang.ada
 help / color / mirror / Atom feed
From: Georg Bauhaus <rm.dash-bauhaus@futureapps.de>
Subject: Re: Interfacing with C ; an ununsed fields dilemma
Date: Thu, 02 Jul 2009 11:51:46 +0200
Date: 2009-07-02T11:51:47+02:00	[thread overview]
Message-ID: <4a4c8333$0$32672$9b4e6d93@newsspool2.arcor-online.net> (raw)
In-Reply-To: <faaa30f7-d69b-4c73-ae70-9b01d3804077@d32g2000yqh.googlegroups.com>

Hibou57 (Yannick Duch�ne) schrieb:
> Hello to all,
> 
> Once again, a topic about interfacing with C structures.
> 
> 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 by the exogenous part
> of the application, specially if it is dynamically linked to the
> application (beceause then, its version or its implementation may be
> differente and unknown of the application which rely on it).
> 
> And here is the dilemma :
> 
> Using clause representation, it is tempting to simply drop this
> unuseful unusedfields from the visible part of the declaration (yeah
> dear friend, lot cleaner, really tempting),

Omitting things might be acceptable in mathematical
discourse, but actually writing things down helps a
lot in programming, at least it helps me as a reader,
not up for solving (inter-)language puzzles.
You explanation of the record's gap fields is itself a hint
that these components do need some attention.
Shouldn't therefore Martin's example be the way to go?

This has been discussed before, topics included

   for X use all
      record
         ...
      end record;

pragma Zero_Fill and Unchecked_Conversion (for setting bits to 0);




  parent reply	other threads:[~2009-07-02  9:51 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   ` reserved fields; was " tmoran
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 [this message]
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