Article View: net.lang.c
Article #9291enum function bug?
From: Tom Stockfisch
Date: Thu, 11 Sep 1986 02:48
Date: Thu, 11 Sep 1986 02:48
43 lines
1400 bytes
1400 bytes
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
Technical Details
Message-ID:
<299@sdchema.sdchem.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!nike!ucbcad!ucbvax!sdcsvax!sdchem!tpsShow Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: arc1-ca.pugleaf.net!utzoo!mnetor!seismo!lll-crg!nike!ucbcad!ucbvax!sdcsvax!sdchem!tps From: tps@sdchem.UUCP (Tom Stockfisch) Newsgroups: net.lang.c Subject: enum function bug? Message-ID: <299@sdchema.sdchem.UUCP> Date: Wed, 10-Sep-86 22:48:52 EDT Article-I.D.: sdchema.299 Posted: Wed Sep 10 22:48:52 1986 Date-Received: Thu, 11-Sep-86 21:25:13 EDT Reply-To: tps@sdchema.UUCP (Tom Stockfisch) Distribution: na Organization: Chemistry Dept, UC San Diego Lines: 43