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: 109fba,582dff0b3f065a52 X-Google-Attributes: gid109fba,public X-Google-Thread: 1014db,582dff0b3f065a52 X-Google-Attributes: gid1014db,public X-Google-Thread: 103376,bc1361a952ec75ca X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-08-10 07:12:00 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!skynet.be!skynet.be!louie!not-for-mail Sender: - From: Bart.Vanhauwaert@nowhere.be Subject: Re: How Ada could have prevented the Red Code distributed denial of service attack. Newsgroups: comp.lang.ada,comp.lang.c,comp.lang.c++ References: <3b690498.1111845720@news.worldonline.nl> <9kbu15$9bj@augusta.math.psu.edu> <9kbvsr$a02@augusta.math.psu.edu> <3B69DB35.4412459E@home.com> <9kp9n7$ivm$1@nh.pace.co.uk> <3B722166.AFBFE73A@home.com> <3B7329A2.959E04B4@home.com> User-Agent: tin/1.4.4-20000803 ("Vet for the Insane") (UNIX) (Linux/2.2.17-21mdksecure (i686)) Date: Fri, 10 Aug 2001 14:29:51 +0200 Message-ID: NNTP-Posting-Host: 194.78.202.248 X-Trace: 997452715 reader0.news.skynet.be 54319 194.78.202.248 X-Complaints-To: abuse@skynet.be Xref: archiver1.google.com comp.lang.ada:11761 comp.lang.c:73399 comp.lang.c++:81538 Date: 2001-08-10T14:29:51+02:00 List-Id: Warren W. Gay VE3WWG wrote: > So when you do a FETCH from an relational database, into a string > column value, you're going to use a dynamic array? What initial I am going to use std::string. Why not? >> But once you start thinking this >> was it ends up in your protocols (oeps, lucky we had some >> reserved(1..12) of character at the end of our message!), in >> your file formats, etc.. where the real problems are. > APIs and protocols often have fixed sizes in them. Sheesh, where > have you been? Have you looked at TCP/IP headers for example? Yes. And fixed four byte IP addresses cause enough headaches already. >> pipe(&my_vector[0]); > OK, but will your junior programmer you just hired do that? Really? He probably will, but he will also probably not know that is a potentially unspecified thing :) Will your junior programmer you just hired program Ada? Really? >> (Yes technically, the wording of the current C++ standard is not clear >> enough, but there is a defect report that rectifies this; it works >> for all current implementations of the STL already in anticipation >> of this correction) > That kind of assumption will "not fly" on rockets, aircraft or space > stations. It should not be the kind of assumption that runs mutual > fund companies, banks or insurance companies either. Yes it's a defect in the C++ standard. It got caught and it will be corrected in the next iteration. (There is nothing dishonest about multiple iterations of a standard is there?) > You've not been listening, obviously. One last time: In Ada there is > no reason to shy away from arrays. Additionally, as Ted Dennison has In C++ there is, but it is not a problem because you can use other equivalent structures, some provided by the STL. Look : you are coming from an Ada background where arrays are augmented up to a point where they became a generic object. But only with different syntax on calling the operators than on a real object. I think that is an inconsitency and shows the time of the signes of early 80'ies when objects where not yet as deeply entranched in peoples mind. At that time a 'better, safer, array' was the best one could think of. In C++ you use a real generic object to represent an array. Same syntax as all other generic objects. You can write array like objects yourself but with different semantics if you really must. (Like, YES, a typesafe fixed size array with bounds checking and everything mentioned in this thread). cu bart -- http://www.irule.be/bvh/