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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,b1208117d36fb121 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-07 17:43:50 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!fu-berlin.de!uni-berlin.de!ppp-3-23.5800-11.telinco.NET!not-for-mail From: nickroberts@ukf.net (Nick Roberts) Newsgroups: comp.lang.ada Subject: Re: System.Address'Size - not a static integer expression? Date: Mon, 08 Apr 2002 00:43:55 GMT Message-ID: <3cb0ae40.163108090@news.cis.dfn.de> References: <665e587a.0203060957.3682edf7@posting.google.com> NNTP-Posting-Host: ppp-3-23.5800-11.telinco.net (212.1.154.23) X-Trace: fu-berlin.de 1018226628 31851790 212.1.154.23 (16 [25716]) X-Newsreader: Forte Free Agent 1.21/32.243 Xref: archiver1.google.com comp.lang.ada:22205 Date: 2002-04-08T00:43:55+00:00 List-Id: On 6 Mar 2002 09:57:38 -0800, vgodunko@vipmail.ru (Vadim Godunko) strongly typed: >9 type T is record >10 P : System.Address := System.Null_Address; >11 end record; >12 for T'Size use System.Address'Size; Others will tell you GNAT is correct (this is not allowed). Perhaps it might be helpful to analyse a little more deeply why you wrote this code in the first place. Presumably you wanted to say "I want this type to be the same size as System.Address". This is apparently a fairly reasonable requirement, since T only contains a System.Address. However, think again. If the compiler really needs to put some extra information into the record, then it needs it, and the 'for T'Size ...' clause will simply cause the compilation to fail. If the compiler doesn't need to put any extra information in, it won't! So, in conclusion, I think that probably you never needed the representation clause in the first place. I think it might be fair to suggest that quite often the reason why someone gets tangled up with a representation clause (or pragma) is because they are using it inappropriately. All the best, -- Nick Roberts