Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/3/84; site enmasse.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!whuxlm!harpo!decvax!genrad!panda!enmasse!mhs From: mhs@enmasse.UUCP (Mike Schloss) Newsgroups: net.lang.c Subject: Re: Re: more questions about efficient C code Message-ID: <429@enmasse.UUCP> Date: Mon, 1-Jul-85 23:26:27 EDT Article-I.D.: enmasse.429 Posted: Mon Jul 1 23:26:27 1985 Date-Received: Fri, 5-Jul-85 03:56:44 EDT References: <474@crystal.UUCP> <397@umcp-cs.UUCP> <721@wlcrjs.UUCP> <3136@drutx.UUCP> Distribution: net Organization: Enmasse Computer Corp., Acton, Mass. Lines: 26 > I have noticed lately that if I have the following: > > foo() > { > char c; > > if((c = getchar()) != '\n') { > /* more code here */ > } > } > > and I do not use 'c' any where else lint complains. I get the message > > c set but no used in function foo > Whats the problem? Lint is telling you that your loop keeps assigning a value to c and never ever using it. (Is c in WOM :-) You could get away with something like this: foo() { if (getchar() != '\n') { /* more code here */ } }