comp.lang.ada
 help / color / mirror / Atom feed
From: nickroberts@ukf.net (Nick Roberts)
Subject: Re: System.Address'Size - not a static integer expression?
Date: Mon, 08 Apr 2002 00:43:55 GMT
Date: 2002-04-08T00:43:55+00:00	[thread overview]
Message-ID: <3cb0ae40.163108090@news.cis.dfn.de> (raw)
In-Reply-To: 665e587a.0203060957.3682edf7@posting.google.com

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



      parent reply	other threads:[~2002-04-08  0:43 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-06 17:57 System.Address'Size - not a static integer expression? Vadim Godunko
2002-03-07  1:21 ` Robert Dewar
2002-03-07 13:56   ` Wes Groleau
2002-03-08 18:34     ` FGD
2002-03-08 19:07       ` Larry Kilgallen
2002-03-08 19:43       ` Wes Groleau
2002-04-08  4:57         ` Robert Dewar
2002-04-08 15:17           ` Wes Groleau
2002-04-10  1:54             ` Robert Dewar
2002-04-10 17:41               ` Wes Groleau
2002-04-10 18:29                 ` Darren New
2002-04-12 20:20                 ` Robert Dewar
2002-04-12 21:10                   ` Wes Groleau
2002-04-14 19:59                     ` Robert Dewar
2002-04-14 20:01                     ` Robert Dewar
2002-04-15 15:13                       ` Wes Groleau
2002-04-15 19:57                         ` Randy Brukardt
2002-04-17  3:22                           ` Robert Dewar
2002-04-17  3:11                         ` Robert Dewar
2002-04-17 18:27                           ` Wes Groleau
2002-04-19 14:06                             ` Robert Dewar
2002-04-19 15:05                               ` Wes Groleau
2002-04-20  2:26                                 ` Robert Dewar
2002-04-20  5:11                                 ` Robert Dewar
2002-04-20 16:50                                   ` Darren New
2002-04-22  9:20                                   ` Ole-Hjalmar Kristensen
2002-04-22 13:24                                     ` Robert Dewar
2002-04-22 13:59                                       ` Ole-Hjalmar Kristensen
2002-04-22 13:34                                     ` Robert Dewar
2002-04-22 14:02                                       ` Ole-Hjalmar Kristensen
2002-04-22 16:11                                         ` Jean-Pierre Rosen
2002-04-22 23:57                                         ` Robert Dewar
2002-04-08  0:43 ` Nick Roberts [this message]
replies disabled

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