🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #5221

Re: Pointer to void (was: function returning pointer to itself)

#5221
From: T. William Wells
Date: Sun, 24 Jul 1988 15:51
18 lines
1340 bytes
In article <1066@agora.UUCP> rickc@agora.UUCP (Rick Coates) writes:
: Can someone elaborate on why ANSI does not allow void pointers for
: functions?

The basic reason is that data pointers and function pointers can
have very different sizes.  I have heard claims for function
pointers with 7x and 9x data pointer sizes.  (Anybody want to say
which machines?) And, of course, there is the IBM-PC, where
certain programming models may use far function pointers and near
data pointers (or v.v.), a difference of 2x.

Given this, it is desirable to have generic function and data
pointers not be commensurable in order to save memory for the
shorter data type.  Of course, this can be taken to the extreme
where there are no generic pointer types.

For one who needs a data structure which can hold both types of
pointers, use a union.
Technical Details
Message-ID: <531@proxftl.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!decvax!decwrl!purdue!mailrus!uflorida!novavax!proxftl!bill
References: <5485@batcomputer.tn.cornell.edu> <1066@agora.UUCP>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watmath!clyde!bellcore!decvax!decwrl!purdue!mailrus!uflorida!novavax!proxftl!bill
From: bill@proxftl.UUCP (T. William Wells)
Newsgroups: comp.std.c
Subject: Re: Pointer to void (was: function returning pointer to itself)
Message-ID: <531@proxftl.UUCP>
Date: 24 Jul 88 15:51:11 GMT
References: <5485@batcomputer.tn.cornell.edu> <1066@agora.UUCP>
Reply-To: bill@proxftl.UUCP (T. William Wells)
Organization: Proximity Technology, Ft. Lauderdale
Lines: 18