From: Hyman Rosen <hyrosen@mail.com>
Subject: Re: [Spark] Arrays of Strings
Date: Wed, 09 Apr 2003 08:38:07 -0400
Date: 2003-04-09T08:38:07-04:00 [thread overview]
Message-ID: <1049891888.75004@master.nyc.kbcfp.com> (raw)
In-Reply-To: <slrnb97pl4.or.lutz@taranis.iks-jena.de>
Lutz Donnerhacke wrote:
> pragma Suppress(All_Checks);
> subtype Buffer_Index is Positive range 1 .. 10;
> subtype Buffer is String(Buffer_Index);
> outbuf : Buffer;
> outlast : Natural;
> outbuf := Buffer'(
> 1 => 'E', 2 => 'r', 3 => 'r', 4 => 'o', 5 => 'r',
> others => ' ');
> outlast := 5;
> end if;
>
> outlast := outlast + 1;
> outbuf(outlast) := ASCII.LF;
My God, but this code is cringe-inducing! Is there really no way
to fill the buffer except with this character indexing stuff?
Not only that, but all checks are suppressed, and a type Natural
variable is being used to index and write into a fixed size buffer.
You are just begging for a buffer overflow error here.
This is what the reliable Spark subset of Ada gives you? I always
figure people are fooling themselves when they claim their languages
give them reliability, but I expected a little more from Ada!
next prev parent reply other threads:[~2003-04-09 12:38 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-08 12:02 [Spark] Arrays of Strings Lutz Donnerhacke
2003-04-08 18:08 ` Martin Krischik
2003-04-09 9:23 ` Lutz Donnerhacke
2003-04-09 12:38 ` Hyman Rosen [this message]
2003-04-09 12:47 ` Vinzent Hoefler
2003-04-09 14:27 ` Hyman Rosen
2003-04-09 15:13 ` Vinzent Hoefler
2003-04-09 17:21 ` Hyman Rosen
2003-04-09 18:41 ` Vinzent Hoefler
2003-04-09 21:04 ` Randy Brukardt
2003-04-10 23:21 ` John R. Strohm
2003-04-11 12:19 ` Hyman Rosen
2003-04-11 13:14 ` John R. Strohm
2003-04-09 7:50 ` Eric G. Miller
2003-04-09 8:10 ` Lutz Donnerhacke
2003-04-09 18:23 ` Matthew Heaney
2003-04-09 17:42 ` Matthew Heaney
2003-04-09 21:06 ` Randy Brukardt
2003-04-10 8:23 ` Lutz Donnerhacke
2003-04-10 14:09 ` Matthew Heaney
2003-04-10 14:48 ` Hyman Rosen
2003-04-11 6:20 ` Chad R. Meiners
2003-04-11 12:31 ` Hyman Rosen
2003-04-11 18:27 ` Chad R. Meiners
2003-04-11 7:35 ` Phil Thornley
2003-04-11 12:05 ` Marin David Condic
2003-04-11 13:19 ` John R. Strohm
2003-04-12 23:09 ` Robert A Duff
2003-04-11 18:47 ` Chad R. Meiners
2003-04-12 23:51 ` Robert A Duff
2003-04-13 5:47 ` Hyman Rosen
2003-04-14 8:05 ` Lutz Donnerhacke
2003-04-10 15:02 ` Lutz Donnerhacke
2003-04-10 15:50 ` Hyman Rosen
2003-04-10 18:32 ` Randy Brukardt
2003-04-11 6:28 ` Chad R. Meiners
2003-04-11 8:11 ` Lutz Donnerhacke
2003-04-11 12:32 ` Rod Chapman
2003-04-11 14:50 ` Peter Amey
2003-04-11 18:41 ` Matthew Heaney
2003-04-11 21:25 ` Chad R. Meiners
2003-04-12 10:08 ` Peter Amey
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox