Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!ames!ucbcad!ucbvax!ucdavis!deneb!cccmark From: cccmark@ucdavis.UUCP (Mark Nagel) Newsgroups: comp.lang.c,news.software.b Subject: Re: passing NULL to functions Message-ID: <416@ucdavis.UUCP> Date: Sat, 2-May-87 20:26:57 EDT Article-I.D.: ucdavis.416 Posted: Sat May 2 20:26:57 1987 Date-Received: Sun, 3-May-87 08:38:25 EDT References: <150@sds.UUCP> <1129@ius2.cs.cmu.edu> <258@homxb.UUCP> <1000@uw-nsr.UUCP> Reply-To: cccmark@deneb.UUCP (Mark Nagel) Organization: University of California, Davis Lines: 37 Xref: mnetor comp.lang.c:2034 news.software.b:585 In article <1000@uw-nsr.UUCP> john@uw-nsr.UUCP (John Sambrook 5-7433) writes: >In article <258@homxb.UUCP> gemini@homxb.UUCP (Rick Richardson) writes: >>In article <1129@ius2.cs.cmu.edu>, edw@ius2.cs.cmu.edu.UUCP writes: >>> Not that I doubt you, but could you show me >>> where you benifit or need pointers of different size? >> >>Medium model on an 80x8x family (arch flames to /dev/null), where pointers >>to functions are 32 bits, but pointers to data are 16 bits, to name one >>example. > >I believe the Honeywell GPS-45 series systems have chararacter pointers that >are 6 bytes in length while pointers to other objects are 4 bytes. > I hadn't realized there were actually machines with different sized pointers before this -- what a sheltered life! Anyway, I have been thinking about this and was wondering if the function prototyping available in ANSI C will take care of the problem mentioned. Obviously, 0 (or NULL) can be formed into the correct bit pattern if necessary when it appears as an r-value. The correct value can be inferred from the l-value. But in parameter passing, the type of the argument is unknown, so different sized pointers will blow it up. Since function prototypes will allow knowledge of function argument types, will the passing of NULL be a problem any longer? -- - Mark Nagel "Don't ever let anything mechanical know you are in a hurry." ucdavis!deneb!cccmark@ucbvax.berkeley.edu (ARPA) mdnagel@ucdavis (BITNET) ...!{sdcsvax|lll-crg|ucbvax}!ucdavis!deneb!cccmark (UUCP) Disclaimer: If you were my employer would *you* be responsible for my opinions?