comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: GNAT "alignment value must be positive"
Date: Thu, 9 Apr 2015 19:21:53 -0500
Date: 2015-04-09T19:21:53-05:00	[thread overview]
Message-ID: <mg7531$65t$1@loke.gir.dk> (raw)
In-Reply-To: ac4c104c-ebcc-4132-9c53-783dfc083891@googlegroups.com

<marciant@earthlink.net> wrote in message 
news:ac4c104c-ebcc-4132-9c53-783dfc083891@googlegroups.com...
>On Wednesday, April 8, 2015 at 4:35:23 PM UTC-4, Randy Brukardt wrote:
>> ...
>>
>> I should have added that the Recommended Level of Support does seem to
>> require supporting that (probably should have read it before pushing
>> "send"!), so in that sense, it's a GNAT bug to not allow it. But
>> practically, 0 and 1 are the same for a specified alignment; nothing is
>> going to be different about the default allocation, so it's doesn't 
>> really
>> matter.
>>
>>                                             Randy.
>
>Are you saying that it is not necessary to specify alignment zero for
> records that end up specifying components of enclosing records whose
> layout is being fully "rep-spec'd" (pragma Pack is not being used?).

It never was.

> Is it not (no longer?) necessary to ever indicate - as per Ada 95 RM 13.3 
> [14]

This paragraph is about "Address", not sure as to what you're referring.

But the Ada 95 wording for Alignment contained a lot of nonsense. It was 
mostly rewritten for Ada 2005, as Binding Interpretation (meaning it applies 
to Ada 95 compilers as well), so reading the original wording does nothing 
but confuse yourself and everyone else.

> - "zero means that the object is not necessarily aligned on a storage 
> element
> boundary."?

That's talking about the value of X'Alignment, when it is *read*, not so 
much when it is specified. (This is 13.3(23/2)).
>  Should "object" in the above really be "subtype" or object?  Is it no 
> necessary
> to indicate "not necessarily aligned on a storage element boundary" for 
> anything?

No, the subtype wording is completely separate, because (as I noted), the 
old wording was nonsense. I'm not going to try to explain old nonsense. If 
we could have explained it, we wouldn't have rewritten it!

> I know that those are a lot of questions but I am trying to understand 
> enough to
> gain "full command" of this aspect of the language: I have always (at this 
> point
> about 25 years!) been very interested in hardware and communication 
> interface
> design in Ada.

Then read the current RM, not older, buggier versions. The bleeding edge can 
be found at: http://www.ada-auth.org/standards/ada2x.html (this contains 
everything the ARG has approved to date). Ada 2012 can be found at: 
http://www.ada-auth.org/arm.html.

People discover bugs in the RM all the time, and the ARG fixes them 
periodically. It's often impossible to explain the original wording, because 
it didn't make sense for one reason or another. There's a reason that newer 
standard replace the older ones (even if that doesn't always happen 
practically).

                                         Randy.






  reply	other threads:[~2015-04-10  0:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-08 20:35 GNAT "alignment value must be positive" Randy Brukardt
2015-04-09 13:28 ` marciant
2015-04-10  0:21   ` Randy Brukardt [this message]
2015-04-10 15:45     ` marciant
2015-04-10 21:18       ` Randy Brukardt
  -- strict thread matches above, loose matches on Subject: below --
2015-04-06 20:16 marciant
2015-04-06 20:48 ` Shark8
2015-04-07 15:28   ` marciant
2015-04-07 15:27 ` marciant
2015-04-07 18:46   ` Jeffrey Carter
2015-04-07 19:45     ` marciant
2015-04-08 20:18     ` Randy Brukardt
replies disabled

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