Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83; site ncoast.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!genrad!decvax!cwruecmp!atvax!ncoast!bsa
From: bsa@ncoast.UUCP (Brandon Allbery)
Newsgroups: net.lang.c
Subject: Re: Ptr to func doesn't like casting??
Message-ID: <457@ncoast.UUCP>
Date: Mon, 3-Dec-84 09:13:45 EST
Article-I.D.: ncoast.457
Posted: Mon Dec  3 09:13:45 1984
Date-Received: Thu, 6-Dec-84 05:27:54 EST
References: <13900010@acf4.UUCP>
Reply-To: bsa@ncoast.UUCP (Brandon Allbery)
Organization: The Galactic Coordinator's Office, Klovia
Lines: 37
Summary: 

> Article <13900010@acf4.UUCP>, from greenber@acf4.UUCP
+----------------
| given a declaration such as:
| 	int	(* varname)();
| it certainly should point to a function returning int.
| Now if I wish to temporarily hold a pointer to a string there, and I
| get the pointer from a function:
| 	char	*function();
| 	varname = function();
| barfs in any of the lint-like guys I use with a legitimate gripe, that
| is "pointers don't point to same object, you dumbo!".
| 
| Well,
| 	(char *)varname = function();
| doesn't work (lvalue required).
| And,
| 	varname = (*function())();
| doesn't work consistantly.
| 

Perhaps lint and our C are more closely related than I thought they might
be; I once tried to use a

	typedef int (*func)();

and cc barfed all over it.  I forget what error it gave, except that
it looked like it was ignoring the pointer nature of the thing.  Anyone
know whence came this piece of brain-damage?

--bsa
-- 
  Brandon Allbery @ North Coast Xenix  |   the.world!ucbvax!decvax!cwruecmp!
6504 Chestnut Road, Independence, Ohio |       {atvax!}ncoast!{tdi1!}bsa
   (216) 524-1416             \ 44131  | E1439@CSUOHIO.BITNET (friend's acct.)
				       |    BALLBERY (161-7070) on MCI Mail
---------------------------------------+---------------------------------------
	      Keeping the Galaxies safe for Civilization... :-)