Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!hp4nl!philapd!ssp9!dolf From: dolf@idca.tds.PHILIPS.nl (Dolf Grunbauer) Newsgroups: comp.unix.questions Subject: Re: lint: shouldn't it catch this? Keywords: lint c Message-ID: <557@ssp9.idca.tds.philips.nl> Date: 3 Jan 91 10:13:02 GMT References: <1131@van-bc.wimsey.bc.ca> Reply-To: dolf@idca.tds.philips.nl (Dolf Grunbauer) Organization: Philips Information Systems, Apeldoorn, The Netherlands Lines: 28 In article <1131@van-bc.wimsey.bc.ca> jtc@van-bc.wimsey.bc.ca (J.T. Conklin) writes: >In article birnbaum@paul.rutgers.edu (Rich Birnbaum) writes: >>Running lint on this program produces no errors: >> >>main() >>{ >> int i; >> if (0) >> i=0; >> printf ("%d",i); >>} >> >>Shouldn't it complain that 'i' may be used before set? I could have sworn it >>did at some point in my life! > >It should, it doesn't, and ou've probably seen the 'i' may be used >before set mesage before. Rather than doing data flow analysis, lint >raises this warning only if the first use of a variable is access >rather than assignment. > >[DELETED] Shouldn't it also give a warning/error message like: "statement not reached" ? -- _ _ / U | Dolf Grunbauer Tel: +31 55 433233 Internet dolf@idca.tds.philips.nl /__'< Philips Information Systems UUCP ...!mcsun!philapd!dolf 88 |_\ If you are granted one wish do you know what to wish for right now ?