comp.lang.ada
 help / color / mirror / Atom feed
From: Maciej Sobczak <see.my.homepage@gmail.com>
Subject: Re: Pointers explained?
Date: Mon, 30 Jul 2007 14:23:34 -0700
Date: 2007-07-30T14:23:34-07:00	[thread overview]
Message-ID: <1185830614.681672.154960@g4g2000hsf.googlegroups.com> (raw)
In-Reply-To: <1185824195.711745.136860@i13g2000prf.googlegroups.com>

On 30 Lip, 21:36, Adam Beneschan <a...@irvine.com> wrote:

> C++ will of
> course let you do that

C++ will of course let you do that, but this statement itself is
meaningless, because languages are never used directly. In real life
you might want to use a *compiler* to compile the C++ code and recent
versions of g++ produce a nice warning message when you try to return
an address of a local variable (even without any additional options).
I guess other C++ compilers are smart enough to do the same, so it's
not that bad.

On the other hand it is true that the whole scenario can be made more
complex up to the point where the compiler will not catch the problem,
but will have to accept it, so it's not perfect either.

Note that Ada programmers also have 'Unrestricted_Access (GNAT) and
'Unchecked_Access to cheat around the rules.

--
Maciej Sobczak
http://www.msobczak.com/




  reply	other threads:[~2007-07-30 21:23 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-30 17:53 Pointers explained? shaunpatterson
2007-07-30 17:56 ` shaunpatterson
2007-07-30 19:04   ` Ed Falis
2007-07-30 19:05   ` Ludovic Brenta
2007-07-30 19:36   ` Adam Beneschan
2007-07-30 21:23     ` Maciej Sobczak [this message]
2007-07-30 22:36       ` Adam Beneschan
2007-07-31  7:33         ` Dmitry A. Kazakov
2007-07-31  1:15       ` Anh Vo
2007-07-30 22:20     ` Adam Beneschan
2007-07-30 21:31   ` Jeffrey R. Carter
2007-07-31 17:21   ` Simon Wright
2007-07-31 18:06     ` Dmitry A. Kazakov
2007-07-31 22:38       ` shaunpatterson
2007-08-01  7:53         ` Martin Krischik
2007-08-01  8:21         ` Dmitry A. Kazakov
2007-08-10 19:52         ` Simon Wright
2007-07-30 20:11 ` Dmitry A. Kazakov
2007-07-31  8:28 ` Martin Krischik
  -- strict thread matches above, loose matches on Subject: below --
2007-07-30 17:53 shaunpatterson
replies disabled

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