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.8 required=5.0 tests=BAYES_00,INVALID_DATE, LOTS_OF_MONEY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1ba8c21ddfbe0b1e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 1995-01-05 02:27:19 PST Newsgroups: comp.lang.ada Path: nntp.gmd.de!newsserver.jvnc.net!news.cac.psu.edu!news.pop.psu.edu!hudson.lm.com!netline-fddi.jpl.nasa.gov!elroy.jpl.nasa.gov!usc!bloom-beacon.mit.edu!uhog.mit.edu!uw-beaver!pattis From: pattis@cs.washington.edu (Richard Pattis) Subject: Re: "Subtract C, add Ada" Message-ID: Summary: Here is documentation of a real == error in C Sender: news@beaver.cs.washington.edu (USENET News System) Organization: Computer Science & Engineering, U. of Washington, Seattle References: <862035D1F1C@annwfn.com> Date: Thu, 5 Jan 1995 04:30:16 GMT Date: 1995-01-05T04:30:16+00:00 List-Id: In article <862035D1F1C@annwfn.com> merlin@annwfn.com (Fred McCall) writes: >In mg@asp.camb.inmet.com Mitch Gart writes: > >>Ada leaves less room for single-keystroke >>errors, such as the common C error of using = (assignment) instead of >>== (comparison); > >I've always been curious. Just *where* is this a "common C error"? >I've seen lots of beginners and non-C programmers claim it is, but I >don't recall ever hearing of anyone who knew what they were doing (and >who was using a real tool -- say, lint -- to check their code) making >it. In Peter van der Linden's excellent book, "Expert C Programming: Deep C Secrets", Prentice Hall, on page xx (that's 20 in the preface) he describes a problem from 1993 in the Operating System development group at SunSoft (he works at Sun and was part of the debugging effort he describes). A bug in the asynchronous I/O libary was holding up a $20million dollar sale - the customer needed the library to work. It turns out that someone had written x==2 by accident. As van der Linden states "Some versions of the lint program would have detected this problem, but it's all too easy to avoid the automatic use of this essential tool." Rich -- ------------------------------------------------------------------------------ Richard E. Pattis "Programming languages are like Looking for a Job pizzas - they come in only "too" size: too big and too small.