Path: utzoo!attcan!uunet!husc6!bbn!mit-eddie!rutgers!mcnc!rti!xyzzy!meissner From: meissner@xyzzy.UUCP (Usenet Administration) Newsgroups: comp.lang.c Subject: Re: retiring gets(3) Message-ID: <1977@xyzzy.UUCP> Date: 22 Nov 88 01:24:11 GMT References: <1988Nov8.054845.23998@utstat.uucp> <7963@bloom-beacon.MIT.EDU> <4509@aldebaran.UUCP> Reply-To: meissner@xyzzy.UUCP (Michael Meissner) Organization: Data General (Languages @ Research Triangle Park, NC.) Lines: 26 In article <4509@aldebaran.UUCP> jimp@cognos.UUCP (Jim Patterson) writes: /* stuff deleted */ | I know of at least one system where the system convention is not 0; | Data General MV systems have instructions which take -1 as the null | pointer value, and this has persisted through many system call | conventions as well. However, the C implementation still considers a | null pointer to be 0 even though this requires quite a bit of "glue" | around some system calls to interface between the two formats. | Requiring that the "null pointer constant" be 0, as ANSI C does, just | makes any other implementation painfully difficult (and is begging for | problems when porting software as well). Sigh.... Yes the MV does have some queue instructions that take -1 for a null pointer. However, the general NULL pointer as defined by the C library is all 0's, as it is for other DG languages. Whatever other faults we have (three pointer types, etc.), a non-zero NULL is not one of them. And yes there are some system calls that want -1 in pointer fields as a special value, there are also system calls that want you to do a logical OR with the high bit set. Such is life..... -- Michael Meissner, Data General. Uucp: ...!mcnc!rti!xyzzy!meissner Arpa: meissner@dg-rtp.DG.COM (or) meissner%dg-rtp.DG.COM@relay.cs.net