Thread View: comp.bugs.sys5
1 messages
1 total messages
Started by Steve Losen
Fri, 16 Dec 1988 22:39
bug in lint with void (*f)()
Author: Steve Losen
Date: Fri, 16 Dec 1988 22:39
Date: Fri, 16 Dec 1988 22:39
36 lines
1221 bytes
1221 bytes
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
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads