bug in lint with void (*f)()
Steve Losen
scl at virginia.acc.virginia.edu
Sat Dec 17 08:39:51 AEST 1988
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 at virginia.edu
University of Virginia Academic Computing Center
More information about the Comp.bugs.sys5
mailing list