Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!utgpu!water!watmath!clyde!rutgers!seismo!mcvax!hafro!askja!frisk From: frisk@askja.UUCP Newsgroups: comp.lang.c Subject: A bug in 'lint' Message-ID: <273@askja.UUCP> Date: Mon, 17-Aug-87 15:58:10 EDT Article-I.D.: askja.273 Posted: Mon Aug 17 15:58:10 1987 Date-Received: Wed, 19-Aug-87 07:12:09 EDT Distribution: world Organization: University of Iceland (RHI) Lines: 32 Keywords: lint bug cc Take a look at the (*) marked line in following code fragment: main() { int x; x = 1; x && x += 1; /* (*) */ return(0); } That line does not make any sense of course, since && has higher precedence than +=. Changing it to x && (x += 1); would make it legal (but still stupid), but that's not the point here. RATHER ..... The lint program is perfectly happy with it (at least on HP/UX, Eunice, and Altos SysV Unix). (And what's even worse, so is cc on Eunice and Altos SysV Unix) cc on HP/UX complains (correctly) (as MSC does) that "x && x" is not an lvalue. Any comments ? -- Fridrik Skulason Univ. of Iceland, Computing Center UUCP ...mcvax!hafro!askja!frisk BIX frisk "This line intentionally left blank"