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!newsfeed00.sul.t-online.de!t-online.de!news-lei1.dfn.de!news-ham1.dfn.de!news.uni-hamburg.de!cs.tu-berlin.de!uni-duisburg.de!not-for-mail From: Georg Bauhaus Newsgroups: comp.lang.ada Subject: Re: Object with zero bits Date: Thu, 14 Oct 2004 00:47:17 +0000 (UTC) Organization: GMUGHDU Message-ID: References: <5ad0dd8a.0410130718.6a7bd161@posting.google.com> <2t5jo2F1s56mgU1@uni-berlin.de> NNTP-Posting-Host: l1-hrz.uni-duisburg.de X-Trace: a1-hrz.uni-duisburg.de 1097714837 7723 134.91.1.34 (14 Oct 2004 00:47:17 GMT) X-Complaints-To: usenet@news.uni-duisburg.de NNTP-Posting-Date: Thu, 14 Oct 2004 00:47:17 +0000 (UTC) User-Agent: tin/1.5.8-20010221 ("Blue Water") (UNIX) (HP-UX/B.11.00 (9000/800)) Xref: g2news1.google.com comp.lang.ada:5175 Date: 2004-10-14T00:47:17+00:00 List-Id: Nick Roberts wrote: : Georg Bauhaus wrote: : :> : You can declare a record that will have zero bits size. Is this what :> : you want? :> : :> : type Frame_Mark is null record; :> :> And maybe add a rep clause, :> :> type Nothing_At_All is null record; :> for Nothing_At_All'size use 0; : : 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 :-)