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: g2news1.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!nx02.iad01.newshosting.com!newshosting.com!198.186.194.249.MISMATCH!transit3.readnews.com!news-xxxfer.readnews.com!news-out.readnews.com!postnews7.readnews.com!not-for-mail Date: Tue, 08 Feb 2011 12:13:55 -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> <8r86vgFc3uU1@mid.individual.net> <19fh1chm74f9.11cws0j5bckze.dlg@40tude.net> <4d516394$0$29394$882e7ee2@usenet-news.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4d517a70$0$29394$882e7ee2@usenet-news.net> NNTP-Posting-Host: ebae8820.usenet-news.net X-Trace: DXC=o1VOkahMMY7IN[0Fm;B`Y1QFZ3T]GPM]7mX0AG3X_jU?7J]G7Of^W10VjKk:Lk^BN1cR12TN^Bg7>i6QJ9?:Y@R2f0D92_G=fB1 X-Complaints-To: abuse@usenet-news.net Xref: g2news1.google.com comp.lang.ada:17003 Date: 2011-02-08T12:13:55-05:00 List-Id: On 2/8/2011 11:44 AM, Adam Beneschan wrote: > But if C has been working this way for forty years, and its > programmers still can't get it right (as evidenced by the fact that > Ludovic found a bug), then it's arguable that the language is making > it too easy to write incorrect code and too difficult to write code > you can count on. A two-line example such as yours doesn't count as > evidence against that; it's easy to get really short subroutines > correct. The problems come up when you have larger routines. And > I've run into this problem with a program I maintain, in a language > (not C) that also allows value parameters to be modified locally. > Someone has gone into it and written a statement that uses the > parameter, assuming that it's the value that the caller gave it, > without realizing that someone else had written a statement up above > that changed the parameter's value. An anecdotal reference, and not even showing the problematic code, does not constitute compelling evidence. I don't see why the same error might not arise with respect to any variable that a programmer assumes has one value while in fact it has been changed to another. > A two-line example such as yours doesn't count as > evidence against that; it's easy to get really short subroutines > correct. The problems come up when you have larger routines. Then don't write large routines. In fact, you should switch to my new imaginary programming language Lydia. In that language, all subprograms can be no longer than five lines, since made-up statistics show that 95% of all programming errors occur in subprograms which are longer.