From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,b9880ab5a4975a57 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!news.glorb.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Nick Roberts Newsgroups: comp.lang.ada Subject: Re: Object with zero bits Date: Thu, 14 Oct 2004 03:14:04 +0100 Message-ID: <2t65nbF1s7981U1@uni-berlin.de> References: <5ad0dd8a.0410130718.6a7bd161@posting.google.com> <2t5jo2F1s56mgU1@uni-berlin.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.uni-berlin.de bmntc5d9cTLBsZVLmBq/XAC9nUE9wprEqWay/bJu+VmW1WRgE= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040803 X-Accept-Language: en-us, en In-Reply-To: Xref: g2news1.google.com comp.lang.ada:5178 Date: 2004-10-14T03:14:04+01:00 List-Id: 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