enum function bug?

Tom Stockfisch tps at sdchem.UUCP
Thu Sep 11 12:48:52 AEST 1986


I want to pass a
	pointer to function returning "bool"
to a function, but lint says I'm not doing it right.  I think I am, aren't I?
Sample code follows with messages from lint inserted.  Is this a bug?


typedef enum { FALSE = 0, TRUE = 1 }	bool;

bool	truth();
void	f(), g();

main()
{
/*###8 [lint] f arg. 1 used inconsistently testbool.c(14) :: testbool.c(8)%%%*/
	f( truth );
}

void
f( ft )
	bool	(*ft)();
/*###14 [lint] f arg. 1 used inconsistently testbool.c(14) :: testbool.c(8)%%%*/
{
/*###15 [lint] g arg. 1 used inconsistently testbool.c(21) :: testbool.c(15)%%%*/
	g( ft );
}

void
g( gt )
/*###20 [lint] warning argument gt unused in function g%%%*/
	bool	(*gt)();
/*###21 [lint] g arg. 1 used inconsistently testbool.c(21) :: testbool.c(15)%%%*/
{
}

bool
truth()
{
	return	TRUE;
}
-- 

-- Tom Stockfisch, UCSD Chemistry



More information about the Comp.lang.c mailing list