Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 6/24/83; site cyb-eng.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!ut-sally!oakhill!cyb-eng!howard From: howard@cyb-eng.UUCP (Howard Johnson) Newsgroups: net.lang.c Subject: Re: declaring routines which return function pointers Message-ID: <477@cyb-eng.UUCP> Date: Tue, 18-Dec-84 13:06:19 EST Article-I.D.: cyb-eng.477 Posted: Tue Dec 18 13:06:19 1984 Date-Received: Thu, 20-Dec-84 02:36:26 EST References: <249@alberta.UUCP> <423@gitpyr.UUCP> Distribution: net Organization: Cyb Systems, Austin, TX Lines: 32 > I have a routine which resembles the following: > > int (*f)(); > int fa(), fb(); > > fa() { > f = fb; > return(f); > } > > fb() { > } > > The problem with the above is that lint complains about an illegal combin- > ation of a pointer with an integer in the 'return' statement. I have tried > various casts and function declarations to try to satisfy lint, but none of > them have worked. Does anybody know what I should do to keep lint happy? I thought more people knew the answer to this one. On our Unisoft System V system, the signal system call looks something like this: int (*signal(sig, func))() int (*func)(); { static int (*oldsig)(); /* code */; return(oldsig); } -- Howard Johnson Cyb Systems, Austin, TX ..!{gatech,harvard,ihnp4,nbires,noao,seismo}!ut-sally!cyb-eng!howard