Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!srhqla!demott!kdq From: kdq@demott.com (Kevin D. Quitt) Newsgroups: comp.lang.c Subject: Re: Funny mistake Message-ID: <1991Feb26.212053.16302@demott.com> Date: 26 Feb 91 21:20:53 GMT References: Distribution: comp Organization: DeMott Electronics Co., Van Nuys CA Lines: 28 In article wolfram@cip-s05.informatik.rwth-aachen.de (Wolfram Roesler) writes: >Hello out there, >I had a funny mistake the other day you might be interested in. It was an >obvious syntax error which resulted in legal C code. Funny too how many times >I read over it without seeing whats wrong. > >What I wanted to write was: > > if (fct(a,b,c)) > >but by mistake I wrote: > > if (fct(a,b),c) > >Easy to see here, but hard to discover when it's not a b c but some speaking >variable names like NoOfLines or ErrorFlag or FilePtr or something. > >Perhaps that's why many people refuse to use speaking variable names... :) This is why god invented prototypes. -- _ Kevin D. Quitt demott!kdq kdq@demott.com DeMott Electronics Co. 14707 Keswick St. Van Nuys, CA 91405-1266 VOICE (818) 988-4975 FAX (818) 997-1190 MODEM (818) 997-4496 PEP last