comp.lang.ada
 help / color / mirror / Atom feed
From: Nick Roberts <nick.roberts@acm.org>
Subject: Re: Object with zero bits
Date: Thu, 14 Oct 2004 03:14:04 +0100
Date: 2004-10-14T03:14:04+01:00	[thread overview]
Message-ID: <2t65nbF1s7981U1@uni-berlin.de> (raw)
In-Reply-To: <ckkial$7hb$1@a1-hrz.uni-duisburg.de>

Georg Bauhaus wrote:

> : But many (perhaps most) compilers will make an object (or component) of
> : type (subtype) Nothing_At_All at least size 1 (one bit).
> 
> An object of type Nothing_At_All can be 8 bits in size.
> But Nothing_At_All as a record component seems to vanish,
> 
>   type Num is limited record
>      virt: Nothing_At_All := initialize_Num(Num'access);
>      n: Natural;
>   end record;
> 
>   pragma assert(Num'Max_Size_in_Storage_Elements = 4);
> 
> With suitable rep clauses, Boolean discriminants don't seem to consume
> space in some variant records, when the compiler can find out :-)

Which compiler please?  Would you be kind enough to post test code.

-- 
Nick Roberts



  reply	other threads:[~2004-10-14  2:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-13  6:15 Object with zero bits Robert C. Leif
2004-10-13 14:59 ` Nick Roberts
2004-10-13 15:18 ` Wojtek Narczynski
     [not found]   ` <ckjns1$342$1@a1-hrz.uni-duisburg.de>
     [not found]     ` <2t5jo2F1s56mgU1@uni-berlin.de>
2004-10-14  0:47       ` Georg Bauhaus
2004-10-14  2:14         ` Nick Roberts [this message]
2004-10-14 14:55           ` Georg Bauhaus
2004-10-14  8:13     ` Martin Krischik
replies disabled

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