From: marciant@earthlink.net
Subject: Re: GNAT "alignment value must be positive"
Date: Fri, 10 Apr 2015 08:45:09 -0700 (PDT)
Date: 2015-04-10T08:45:09-07:00 [thread overview]
Message-ID: <ae527812-cf69-4141-8cdb-7d44f0be19a3@googlegroups.com> (raw)
In-Reply-To: <mg7531$65t$1@loke.gir.dk>
On Thursday, April 9, 2015 at 8:21:55 PM UTC-4, Randy Brukardt wrote:
...
> > 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.
Sorry that should have been [24] not [14], as in Ada 95 RM 13.3 [24].
By the way, the project that is still using a compiler that was made
more that ten years ago and we all have copies of RM95;6.0 to read, not
the newer RM.
> 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.
Unfortunately, updating the RM does not cause the project to have access
to an updated compiler. :)
>
> > - "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)).
But if the "natural"/"default" alignment that an implementation would use when it places an object of some type is - lets say 2, what about the case that a user program does unchecked conversion on a sequence of bits to a record type that ends up making the alignment of some of the records components not have the default alignment (not 2 in the example - infact not even alignment 1).
I thought that this was a case where the user should specify alignment 0 for the component's type and that without doing that, improper reading of the component by the program might be the result, due to the compiler having assumed that the component/"object" had its default alignment.
> ...
> 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!
Okay, that is fair enough.
> ...
>
> 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).
I know about the http://www.ada-auth.org RM archive and also read the ARG meeting minutes when each new one is posted (Thank you for your great work on that!)
Vinny
next prev parent reply other threads:[~2015-04-10 15:45 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
2015-04-10 15:45 ` marciant [this message]
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