comp.lang.ada
 help / color / mirror / Atom feed
From: Robert A Duff <bobduff@shell01.TheWorld.com>
Subject: Re: Differences between Ada 83 and other revisions
Date: Wed, 19 Feb 2014 17:09:31 -0500
Date: 2014-02-19T17:09:31-05:00	[thread overview]
Message-ID: <wccd2ii4uw4.fsf@shell01.TheWorld.com> (raw)
In-Reply-To: ldqn70$sl3$1@dont-email.me

"J-P. Rosen" <rosen@adalog.fr> writes:

> Le 16/02/2014 15:13, Robert A Duff a écrit :
>>> But at least it spells out that it is potentially dangerous by being
>>> > called 'Unchecked", like all the other 'Unchecked" parts of the
>>> > language ...very easy to find!
>> If only that were true.  I don't see any "unchecked" here:
>> 
>>     for X'Address use ...;
>> 
>>     X := ...;
>> 
>> It would be great if you could find all unsafe (i.e. potentially
>> erroneous) code by searching for something like "unchecked".
>> But alas.
> But AdaControl can find every use of (instantiations of) Unchecked_*,
> and all usages of 'Address, or only address clauses that refer to the
> address of another object.

That's useful.  Can it find all unsafe features?  There are some
that are quite difficult to detect, such as passing a component
of a variant record to a procedure that causes that component
to vanish.

> There needs to be a boundary between what is checked by the compiler and
> what is best handled by external tools; you may not agree to where the
> line has been drawn, but tools that can find unsafe features do exist!

I didn't mention any compiler checking up there.  I said "search".
I'm asking for a language-design principle that says "you cannot use
any unsafe feature without with-ing a package called Unsafe, or a descendant
thereof".  Then a simple search for "unsafe" finds them all, without
any need for sophisticated tools.

Can you name all the unsafe features of Ada off the top of your head,
and tell what strings to search for to find them?  I can't.  You can
find them by looking up "erroneous" in the Index.

(C is far worse in that regard!)

- Bob

  reply	other threads:[~2014-02-19 22:09 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-13 15:59 Differences between Ada 83 and other revisions yoursurrogategod
2014-02-13 16:12 ` adambeneschan
2014-02-13 18:00   ` yoursurrogategod
2014-02-13 18:07 ` AdaMagica
2014-02-13 19:44 ` Niklas Holsti
2014-02-13 21:25   ` yoursurrogategod
2014-02-13 22:00     ` Niklas Holsti
2014-02-13 22:18       ` adambeneschan
2014-02-14 13:18         ` yoursurrogategod
2014-02-14 13:53           ` AdaMagica
2014-02-14 14:06           ` Jacob Sparre Andersen
2014-02-14 16:47           ` adambeneschan
2014-02-14 14:08         ` Robert A Duff
2014-02-16  9:36         ` Martin
2014-02-16 14:13           ` Robert A Duff
2014-02-16 15:58             ` J-P. Rosen
2014-02-19 22:09               ` Robert A Duff [this message]
2014-02-19 22:23                 ` J-P. Rosen
2014-02-19 22:37                   ` Robert A Duff
2014-04-19  8:59                     ` Jacob Sparre Andersen
2014-02-19 22:34                 ` adambeneschan
2014-02-19 22:58                   ` Robert A Duff
2014-02-13 21:28 ` yoursurrogategod
2014-02-13 23:31   ` Randy Brukardt
2014-02-20 10:30     ` john
replies disabled

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