Path: utzoo!mnetor!uunet!husc6!mit-eddie!ll-xn!ames!elroy!devvax!jackm From: jackm@devvax.JPL.NASA.GOV (Jack Morrison) Newsgroups: comp.lang.c Subject: Re: finding stray /* Message-ID: <1067@devvax.JPL.NASA.GOV> Date: 19 Jan 88 15:42:49 GMT References: <38384@sun.uucp> <3573@sdcc6.ucsd.EDU> <434@drilex.UUCP> <7124@brl-smoke.ARPA> <1464@dataio.Data-IO.COM> <105@ritcv.UUCP> Reply-To: jackm@devvax.JPL.NASA.GOV (Jack Morrison) Organization: Jet Propulsion Laboratory, Pasadena, CA. Lines: 25 [anguish over bugs like: ] >> > a = b/*c; >> >> a = b; /* some explanatory comment >> c = d; /* another comment */ >> 1. These fall in the class of "=" vs. "=="; anyone can write a program to check for all these stupid mistakes we make all the time (yes, even I have one; ask by mail if you want it). I think we've seen enough, yes? 2. "Binary search" for mysterious problems is good as a last resort, but one recommendation (stolen from Robert Ward's helpful book _Debugging C_): rather than deleting code and juggling multiple copies, use #ifdef JUNK ... #endif JUNK to remove the next half from consideration. -- Jack C. Morrison Jet Propulsion Laboratory (818)354-1463 jackm@jpl-devvax.jpl.nasa.gov "The paycheck is part government property, but the opinions are all mine."