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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f2690a5e963b61b6 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local01.nntp.dca.giganews.com!nntp.megapath.net!news.megapath.net.POSTED!not-for-mail NNTP-Posting-Date: Wed, 06 Jul 2005 17:48:32 -0500 From: "Randy Brukardt" Newsgroups: comp.lang.ada References: <1120474891.635131.216700@g44g2000cwa.googlegroups.com> <1120575076.876798.108220@g44g2000cwa.googlegroups.com> <1120583470.429264.325450@g43g2000cwa.googlegroups.com> Subject: Re: GCC 4.0 Ada.Containers Cursor danger. Date: Wed, 6 Jul 2005 17:51:40 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4952.2800 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4952.2800 Message-ID: NNTP-Posting-Host: 64.32.209.38 X-Trace: sv3-RiTX7JqpECzON3KgTHnFwE25fzHc2JRIFWJVi7gKNHMeU75259PHCivFV70Dt/wfhqVRxT8hEXVOgqa!SbuRDKVAgXgSNOUJEg7/IixcdSK1+r0lXqPd7usxv5i1WNkuQG8W6+qUOS1EsBuaC9wJ/TK2nVuO X-Complaints-To: abuse@megapath.net X-DMCA-Complaints-To: abuse@megapath.net X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.32 Xref: g2news1.google.com comp.lang.ada:11914 Date: 2005-07-06T17:51:40-05:00 List-Id: "Pascal Obry" wrote in message news:uk6k42wvf.fsf@obry.net... > > Martin Dowie writes: > > > I doubt if that Ada.Containers would be used in systems that have safety > > concerns. > > I think Dmitriy has a good point. For the first time in Ada we have the > possibility to create easily a dangling pointer using Cursor. This was not > possible before except by using Unchecked_Deallocation. I think the problem is an early implementation of the Containers library. Perhaps I need to write a paper: "Matt Heaney's Container implementation considered harmful." :-) I strongly believe that the Containers implementations provided by default with compilers should do some minimal checking for dangling cursors (that is, err somewhat on the side of safety). Not necessarily going all the way to perfect checking, but at least detect the obvious cases of dangling cursors like the one given previously. OTOH, there will be cases where implementations like Matt's are necessary -- but I'd prefer to call them "Unchecked_Containers" and use them only when performance is critical. Randy.