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-Thread: 103376,c9d5fc258548b22a X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx01.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-out.readnews.com!postnews7.readnews.com!not-for-mail Date: Mon, 07 Feb 2011 09:59:16 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: How do I write directly to a memory address? References: <67063a5b-f588-45ea-bf22-ca4ba0196ee6@l11g2000yqb.googlegroups.com> <31c357bd-c8dc-4583-a454-86d9c579e5f4@m13g2000yqb.googlegroups.com> <05a3673e-fb97-449c-94ed-1139eb085c32@x1g2000yqb.googlegroups.com> <4d4c232a$0$28967$882e7ee2@usenet-news.net> <4D4D6506.50909@obry.net> In-Reply-To: <4D4D6506.50909@obry.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4d50095f$0$22393$882e7ee2@usenet-news.net> NNTP-Posting-Host: 976e599b.usenet-news.net X-Trace: DXC=7B\Z[fcoS?eSIJ?ne=Ml\fQFZ3T]GPM]gmX0AG3X_jUo5K=AA9h=Q1eVjKk:Lk^BNacR12TN^Bg7niLTSFSnaTlm0cUmilhnZPn X-Complaints-To: abuse@usenet-news.net Xref: g2news2.google.com comp.lang.ada:17899 Date: 2011-02-07T09:59:16-05:00 List-Id: On 2/5/2011 9:56 AM, Pascal Obry wrote: > The problem is that it is not possible to enforce a contract in C. > I've seen many bugs just for that. At some point a developer think > about a contract and some time later this is just forgotten (even > if clearly written in comment, who read comments!) and then a crash > arise. Don't tell me you've never run into such situation. I have. Nevertheless, there is an enormous amount of successfully operating C code in existence, and such code is not sprinkled with checks at every opportunity. I have a hunch that the urge to focus on pointer-related errors is something that Ada programmers like to do because it's a class of bugs to which Ada is generally immune, and so they can scan C code for pointers and claim that unchecked ones are all potential errors. But there are plenty of contracts which cannot be enforced just by using the type system, and I venture that most Ada code does not include checks for violations in every context in which the contract is presumed to hold. And is Ada any more immune than C to little Bobby Tables? ()