Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site watdaisy.UUCP
Path: utzoo!watmath!watdaisy!ndiamond
From: ndiamond@watdaisy.UUCP (Norman Diamond)
Newsgroups: net.lang.c
Subject: Re: 4.2 C bugs?
Message-ID: <7032@watdaisy.UUCP>
Date: Mon, 4-Mar-85 12:56:07 EST
Article-I.D.: watdaisy.7032
Posted: Mon Mar  4 12:56:07 1985
Date-Received: Tue, 5-Mar-85 01:52:08 EST
References: <1700001@umn-cs.UUCP>
Organization: U of Waterloo, Ontario
Lines: 32

>    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
	}

-- 

   Norman Diamond

UUCP:  {decvax|utzoo|ihnp4|allegra}!watmath!watdaisy!ndiamond
CSNET: ndiamond%watdaisy@waterloo.csnet
ARPA:  ndiamond%watdaisy%waterloo.csnet@csnet-relay.arpa

"Opinions are those of the keyboard, and do not reflect on me or higher-ups."