comp.lang.ada
 help / color / mirror / Atom feed
From: Lionel.DRAGHI@fr.thalesgroup.com
To: comp.lang.ada@ada-france.org
Subject: RE: Zero_Fill pragma, other proposition
Date: Wed, 21 Jul 2004 11:20:32 +0200
Date: 2004-07-21T11:20:32+02:00	[thread overview]
Message-ID: <mailman.32.1090401708.416.comp.lang.ada@ada-france.org> (raw)



| -----Message d'origine-----
| De: Jean-Pierre Rosen [mailto:rosen@adalog.fr]
...
| OTOH, I suspect that very few types would need
| that pragma (as you describe, a couple of types very strongly 
| connected to hardware), so writing more fields is not really a
| problem.
In our case, it's a common problem : we have lots of messages with spare
fields, and setting them to 0 for out going messages is a requirement.
(On the other hand, even without this requirement, it would ease regression
testing.
Simple regression test tools based on diff raise false alarm because spare
fields may be whatever on each run).

So, our current policy is to explicitly state each spare. I don't feel
confortable with this because the low level representation emerge in the
definition.
I don't want users to access the spare fields.
I don't event want users to see the spare fields.

What could be a good deal is to allows spare fields to appear in the
representation clause.

Kind of :

type Message is record
   Id   : Message_Id;
   Data : Byte_Stream;
end record;

for Message use record
   Id    at 0 range 0 .. 7;
   Spare at 0 range 8 .. 15 := 0; --> ADDED
   Data  at 0 range 16 .. 65;
end record;

This way, representation stuff don't emerge in the "user's" view, but spares
are explicit in the "coder's" view.

-- 
Lionel Draghi



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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-21  9:20 Lionel.DRAGHI [this message]
2004-07-21 10:09 ` Zero_Fill pragma, other proposition Ludovic Brenta
2004-07-21 15:07 ` Nick Roberts
2004-07-21 19:50 ` Wes Groleau
  -- strict thread matches above, loose matches on Subject: below --
2004-07-21 13:17 Lionel.DRAGHI
2004-07-21 16:50 Lionel.DRAGHI
replies disabled

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