delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/06/23/02:15:22

From: jmccarty AT sun1307 DOT spd DOT dsccc DOT com (Mike McCarty)
Newsgroups: comp.lang.c,comp.os.msdos.djgpp
Subject: Re: Casting void pointers
Date: 22 Jun 1998 22:42:32 GMT
Organization: DSC Communications Corporation
Lines: 19
Message-ID: <6mmmko$pee@sun001.spd.dsccc.com>
References: <6mkaos$k7o AT dfw-ixnews6 DOT ix DOT netcom DOT com>
NNTP-Posting-Host: sun1307.spd.dsccc.com
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

In article <6mkaos$k7o AT dfw-ixnews6 DOT ix DOT netcom DOT com>,
Todd Rowan <rowan3 AT ix DOT netcom DOT com_nospam> wrote:
)How do you explicity cast a void pointer to a function pointer? Or do you
)even need to cast void pointers manually?

WARNING! WARNING! DANGER WILL ROBINSON!

Note that void pointers are assignment compatible with DATA pointers of
all types. CODE pointers are not necessarily assignment compatible, and
indeed on some architectures have different physical format and sizes;
function pointers may require MORE STORAGE than data pointers, and hence
not fit in a void pointer.

Mike
-- 
----
char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
I don't speak for DSC.         <- They make me say that.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019