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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: a07f3367d7,c9d5fc258548b22a X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news4.google.com!feeder3.cambriumusenet.nl!feed.tweaknews.nl!85.158.31.10.MISMATCH!newsfeed-0.progon.net!progon.net!news-zh.switch.ch!switch.ch!news.belwue.de!newsfeed.arcor.de!newsspool3.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: How do I write directly to a memory address? Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH 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> Date: Fri, 4 Feb 2011 18:40:48 +0100 Message-ID: <1p4rkrzxjiswj.bbf2pfuxq0dn$.dlg@40tude.net> NNTP-Posting-Date: 04 Feb 2011 18:40:48 CET NNTP-Posting-Host: 26da813a.newsspool3.arcor-online.net X-Trace: DXC=T;SCe?[ On Fri, 04 Feb 2011 11:00:18 -0500, Hyman Rosen wrote: > Did I mention that people who criticize C are like people > who criticize grammar? Every time they do so, their own > criticism contains errors. Right, because nobody really understands C, there is no way to reason about C without running into errors. > You make two errors here. The first is to assume without > any actual knowledge that it is possible for the argument > to be a null pointer; it is likely that the contract for > this procedure requires that it not be. The second is that > you test for the pointer being null each time through the > loop rather than just once. You just made the error of which you accused Ludovic. You assumed a contract that the pointer cannot be modified within the loop, e.g. upon video buffer modification. Quality of a programming language is in great part about how close different people could understand explicit and implied contracts when reading the code. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de