comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Dereferencing and style guides
Date: Fri, 18 Oct 2013 21:46:31 -0500
Date: 2013-10-18T21:46:31-05:00	[thread overview]
Message-ID: <l3srq7$s0h$1@loke.gir.dk> (raw)
In-Reply-To: wcc8uy0t1ec.fsf@shell01.TheWorld.com

"Robert A Duff" <bobduff@shell01.TheWorld.com> wrote in message 
news:wcc8uy0t1ec.fsf@shell01.TheWorld.com...
...
> By "dereference fails", I assume you're talking about null pointers.
> I wasn't so worried about that -- I'm more worried about
> aliasing.  I'm thinking "X^.Y := ..." is a helpful reminder that
> some other pointers might also point to X^.

Besides my other reply, I don't buy this anyway. If X is a parameter, it 
might have other aliases around whether or not it is a pointer (certainly, 
for anything that could be passed by reference). And even if not a parameter 
X, can be aliased by foreign code, chapter 13 stuff, etc.

The moral is, if you worry about potential aliasing, you're just going to 
drive yourself nuts (or be seriously oversimplifying). Aliasing in Ada 
really depends on the type of a name: if it has an elementary type, it's OK 
to assume that it isn't aliased; otherwise, you have to assume that it can 
be. Dereferences are irrelevant to that calculation, so I don't see much 
point in emphasizing them.

                                                  Randy.




  parent reply	other threads:[~2013-10-19  2:46 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-30  6:35 Dereferencing and style guides Natasha Kerensikova
2013-09-30  7:13 ` Dmitry A. Kazakov
2013-09-30 12:51 ` Robert A Duff
2013-09-30 16:49   ` Georg Bauhaus
2013-09-30 18:18     ` Jeffrey Carter
2013-10-03 19:20     ` Robert A Duff
2013-10-04 13:22       ` Georg Bauhaus
2013-10-04 13:25         ` Georg Bauhaus
2013-10-07 16:10       ` Eryndlia Mavourneen
2013-10-08  0:48         ` Robert A Duff
2013-10-10  7:35           ` Stefan.Lucks
2013-10-10 14:48             ` Adam Beneschan
2013-10-10 22:49               ` Robert A Duff
2013-10-11  8:07                 ` Bill Findlay
2013-10-11 12:52                   ` Robert A Duff
2013-10-11 13:02                     ` G.B.
2013-10-11 13:19                     ` Bill Findlay
2013-10-19  2:40                     ` Randy Brukardt
2013-10-19  2:46                     ` Randy Brukardt [this message]
2013-10-19  2:36           ` Randy Brukardt
2013-09-30 13:53 ` Eryndlia Mavourneen
replies disabled

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