Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site brl-tgr.ARPA Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!panda!talcott!harvard!seismo!brl-tgr!ron From: ron@brl-tgr.ARPA (Ron Natalie) Newsgroups: net.lang.c Subject: Re: 4.2 C bugs? Message-ID: <8996@brl-tgr.ARPA> Date: Wed, 6-Mar-85 11:55:46 EST Article-I.D.: brl-tgr.8996 Posted: Wed Mar 6 11:55:46 1985 Date-Received: Fri, 8-Mar-85 03:41:13 EST References: <1700001@umn-cs.UUCP> <7032@watdaisy.UUCP> Organization: Ballistic Research Lab Lines: 29 > > 1) The C compiler (4.2bsd) barfs on the following: > > void foo() {...} > > void blort() {...} > > void (*f[]) () = { > > foo, /* Operands of = have incompat. types*/ > > blort, /* Ditto. */ > > 0 > > } > > It's true. f /* array of pointers */ cannot be initialized to functions. > In the other cases originally cited, integers could be initialized to > pointers, but the conversion is implementation-dependent. > > If you want to initialize pointers to pointers, try: > > void foo() {...} > void blort() {...} > void (*f[]) () = { > &foo, > &blort, > 0 > } > WRONG, foo and blort are correctly the address of the function. His example should work, and does if you are using the system V compiler. The 4.2 BSD compiler has a bug that causes makes it imposible to properly declare pointer to functions returning void. Your example cause the warning " & before arraay or function ignored."