From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,463c5796782db6d8 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-04-09 05:38:10 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!feed2.news.rcn.net!rcn!priapus.visi.com!news-out.visi.com!petbe.visi.com!uunet!ash.uu.net!spool0900.news.uu.net!reader0901.news.uu.net!not-for-mail Date: Wed, 09 Apr 2003 08:38:07 -0400 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4a) Gecko/20030302 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: [Spark] Arrays of Strings References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1049891888.75004@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@fixedcost.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1049891889 reader1.ash.ops.us.uu.net 18188 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:36019 Date: 2003-04-09T08:38:07-04:00 List-Id: 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!