Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!henry From: henry@utzoo.UUCP (Henry Spencer) Newsgroups: net.unix,net.bugs.4bsd,net.lang.c Subject: Re: Bug in 4.2BSD C compiler... Message-ID: <5579@utzoo.UUCP> Date: Thu, 9-May-85 14:08:41 EDT Article-I.D.: utzoo.5579 Posted: Thu May 9 14:08:41 1985 Date-Received: Thu, 9-May-85 14:08:41 EDT References: <1141@sjuvax.UUCP> Organization: U of Toronto Zoology Lines: 18 > ... The question arises on the basis of K&R > pp 114-115, which would seem to indicate that my declaration is acceptable > on the grounds that pointers to integers and pointers to functions returning > integers are supposed to be equationally indistinguishable. I don't know how you got this idea; nothing of the sort appears on pages 114-115 of my copy of K&R. The only thing there that is even vaguely along these lines is the observation that function names don't need an & since the compiler knows they are functions. They still remain pointers to functions, not pointers to integers. Compilers that accept either of your versions are being sloppy. There are many sloppy C compilers in the world. Do not mistake this for sloppiness in the language. "int (*foo[])() = {...}" remains the right way to declare an array of pointers to functions returning int. -- Henry Spencer @ U of Toronto Zoology {allegra,ihnp4,linus,decvax}!utzoo!henry