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,842a00dafb20dd88 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news2.google.com!fu-berlin.de!uni-berlin.de!not-for-mail From: "Nick Roberts" Newsgroups: comp.lang.ada Subject: Re: Rep spec for tagged type Date: Fri, 13 Aug 2004 18:07:18 +0100 Message-ID: References: <87n00z8exk.fsf@goofinder.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; delsp=yes; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.uni-berlin.de 82RrZ6JPzQFXmjRnOi9tVw6WTlbRslO/5qowZN0lliSYc3mO4= User-Agent: Opera M2/7.51 (Win32, build 3798) Xref: g2news1.google.com comp.lang.ada:2720 Date: 2004-08-13T18:07:18+01:00 List-Id: On 13 Aug 2004 20:47:59 +0930, Daniel Wild wrote: > I'm trying to create a rep spec for a tagged type and getting errors > from GNAT that say `compoonent overlaps tag field of ...'. > > I gather this means that GNAT stores the tag for the type at the > beginning of the memory used for the type and I'm trying to overwrite > that by starting my rep spec at 0. > > So, I figure I need to shift my rep spec along by however big the tag > is. How can I find the size of this? (I'd rather do it properly that > assume it's 32 bits on my machine). The expression: Ada.Tags.Tag'Size will probably give you the size of the tag, but for its position you will have to look in the GNAT documentation (maybe it is 0). Unfortunately, I think this means your code may not be portable. -- Nick Roberts