Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site alice.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!alice!ark
From: ark@alice.UUCP (Andrew Koenig)
Newsgroups: net.lang.c
Subject: Re: more questions about efficient C code
Message-ID: <3928@alice.UUCP>
Date: Fri, 28-Jun-85 22:28:37 EDT
Article-I.D.: alice.3928
Posted: Fri Jun 28 22:28:37 1985
Date-Received: Sat, 29-Jun-85 04:00:46 EDT
References: <3136@drutx.UUCP>
Organization: Bell Labs, Murray Hill
Lines: 18

> 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

Ummm... isn't lint right?  Why couldn't you just write:

	if (getchar() != '\n') { ...