Path: utzoo!utgpu!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!cwjcc!hal!nic.MR.NET!tank!mimsy!haven!uvaarpa!virginia!scl From: scl@virginia.acc.virginia.edu (Steve Losen) Newsgroups: comp.bugs.sys5 Subject: bug in lint with void (*f)() Message-ID: <1450@virginia.acc.virginia.edu> Date: 16 Dec 88 22:39:51 GMT Reply-To: scl@virginia.acc.Virginia.EDU.acc.virginia.edu (Stephen C. Losen) Organization: Academic Computing Center, University of Va. Lines: 36 Sorry if this has already been reported... Lint on an AT&T 3b2 running SysV r3.0 behaves inconsistently on this program: ========================= void a() { printf("a\n"); } void b() { printf("b\n"); } main() { void (*emit)(); int i = 1; if (i) emit = a; else emit = b; /* lint buys this */ emit = i ? a : b; /* lint rejects this */ (*emit)(); return(0); } ========================== Evidently lint does not like the combination of the void type and the ?: operator. Lint works fine if I declare everything "int" instead of "void". Anyone have a fix? -- Steve Losen scl@virginia.edu University of Virginia Academic Computing Center