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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1116ece181be1aea X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-10-03 07:24:04 PST Path: archiver1.google.com!news2.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!ngpeer.news.aol.com!newsfeed1!bredband!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Is the Writing on the Wall for Ada? Date: Fri, 3 Oct 2003 14:24:01 +0000 (UTC) Organization: PVV Message-ID: References: <3F7AC5B0.9080108@noplace.com> <3F7B7641.9030908@noplace.com> <3F7C8482.20102@comcast.net> <3F7D69EA.5030707@noplace.com> <3F7D6D38.3030703@noplace.com> NNTP-Posting-Host: kiuk0152.chembio.ntnu.no X-Trace: tyfon.itea.ntnu.no 1065191041 25737 129.241.83.78 (3 Oct 2003 14:24:01 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Fri, 3 Oct 2003 14:24:01 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: archiver1.google.com comp.lang.ada:158 Date: 2003-10-03T14:24:01+00:00 List-Id: On 2003-10-03, Marin David Condic wrote: > Bzzzzt. Wrong answer. Type String is NOT going to let you overflow any > buffers either, is it? Last time I checked, you can't index off the end > of a String. (Or is that about to change in Ada0x? :-) Second, if I'm > interfacing to C a) I'll bet it won't take a Bounded_String to begin > with - must convert to something C can recognize - and b) all bets are > off the instant you gave the address of your parameter to C. C doesn't > feel any moral obligation whatsoever to respect Ada's bounds checking > and a Bounded_String is just another chunk of memory to it. I mean if you use Unbounded_Strings and you convert to a C array without checking that the length is correct according to the length the C lib/db expects. Of course there must be an error in the C part for this to happen, but it usually is. Another is of course DOS attacks if you use a Get_Line version that returns a Unbounded_String. > So I just don't see how I get *anything* of any really big advantage by > using Bounded_String. I get X amount of nuisance and Y amount of extra > advantage and X - Y is greater than zero. Well Unbounded_Strings are quite slow if you deal with a lot of data. Preben