Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcnc!rti!dg_rtp!meissner From: meissner@dg_rtp.UUCP (Michael Meissner) Newsgroups: comp.lang.c Subject: Re: How big is a (??? *) Message-ID: <2108@dg_rtp.UUCP> Date: Sun, 14-Jun-87 09:59:51 EDT Article-I.D.: dg_rtp.2108 Posted: Sun Jun 14 09:59:51 1987 Date-Received: Sat, 20-Jun-87 20:23:18 EDT References: <737@edge.UUCP> <790@mcgill-vision.UUCP> <1243@epimass.EPI.COM> Reply-To: meissner@dg_rtp.UUCP (Michael Meissner) Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 22 In article <1243@epimass.EPI.COM> jbuck@epimass.EPI.COM (Joe Buck) writes: > /* sombody else from edge.UUCP */ > >This should work, but not because of the reason you quoted. K&R says, > >and presumably ANSI follows them in saying, that a pointer to any > >object can be cast to a pointer to any smaller object and back without > >change. Since a char is the smallest object available, any pointer can > >be cast to (char *) and back without change. > > Ah, but what about pointers to functions? There are models for the > 80x86 architecture (boy, I'm glad I don't have to program that thing) > where pointers to data are 16 bits and pointers to functions are 32 > bits. In cases like this, a char pointer isn't wide enough. ANSI has a void * which is guaranteed to be large enough to point to any data object (pre-ANSI could use char *). However, ANSI explicitly says that in standard conforming programs, you cannot convert from a pointer to a function to a pointer to a data object (and vica versa). It is left as a common extension to be able to do so. -- Michael Meissner, Data General Uucp: ...mcnc!rti!dg_rtp!meissner It is 11pm, do you know what your sendmail and uucico are doing?