🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5210

Re: function returning pointer to itself

#5210
From: Tom Stockfisch
Date: Mon, 18 Jul 1988 20:59
22 lines
1344 bytes
In article <7797@watdragon.waterloo.edu) Scott writes:
)In article <664@goofy.megatest.UUCP) djones@megatest.UUCP (Dave Jones) writes:
))From article <7725@watdragon.waterloo.edu), by smking@lion.waterloo.edu (Scott M. King): (me)
))) In article <5485@batcomputer.tn.cornell.edu) olson@tcgould.tn.cornell.edu (olson) writes:
))))Does the new C standard have a natural way to declare a
))))function that returns a pointer to itself

)Or, the function could similarly be declared as
)
)	void *
)main();
)
)since you can quite easily convert any pointer to a void * and back without
)loss of information.
)Scott M. King

Wrong.  (void *) is guaranteed to hold any _data_ pointer.  I believe you
were correct the first time, as I think (void *(*)()) is guaranteed to
hold any function pointer.  (Anyone care to correct me?)
-- 

|| Tom Stockfisch, UCSD Chemistry	tps@chem.ucsd.edu
Technical Details
Message-ID: <259@chem.ucsd.EDU>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!rutgers!ucsd!chem.ucsd.edu!tps
References: <7725@watdragon.waterloo.edu) <664@goofy.megatest.UUCP) <7797@watdragon.waterloo.edu)

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!husc6!rutgers!ucsd!chem.ucsd.edu!tps
From: tps@chem.ucsd.edu (Tom Stockfisch)
Newsgroups: comp.std.c
Subject: Re: function returning pointer to itself
Message-ID: <259@chem.ucsd.EDU>
Date: 18 Jul 88 20:59:58 GMT
References: <7725@watdragon.waterloo.edu) <664@goofy.megatest.UUCP) <7797@watdragon.waterloo.edu)
Reply-To: tps@chem.ucsd.edu (Tom Stockfisch)
Organization: Chemistry Dept, UC San Diego
Lines: 22