Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!husc6!linus!philabs!micomvax!musocs!mcgill-vision!mouse From: mouse@mcgill-vision.UUCP (der Mouse) Newsgroups: comp.lang.c Subject: Re: Distinguished pointers (was Re: Weird syscall returns) Message-ID: <854@mcgill-vision.UUCP> Date: Wed, 5-Aug-87 03:52:30 EDT Article-I.D.: mcgill-v.854 Posted: Wed Aug 5 03:52:30 1987 Date-Received: Sat, 15-Aug-87 08:17:57 EDT References: <1158@copper.TEK.COM> <8317@utzoo.UUCP> Organization: McGill University, Montreal Lines: 23 In article <8317@utzoo.UUCP>, henry@utzoo.UUCP (Henry Spencer) writes: >> I think we need more distinguished pointer values [...]. I have >> [need for other FILE * values] > This is utterly trivial to do [in current C]. Put the following code > fragment into a file and include it in your library: > char myio_no; > char myio_null; > And then include this in the include file for your library: > #define NOFILE ((FILE *)&myio_no) > #define NULLFILE ((FILE *)&myio_null) > This works just fine without any unportable messes like "(char *)-1". Hm. I see no guarantee that NOFILE != NULLFILE. Do it right: FILE myio_no; FILE myio_null; #define NOFILE (&myio_no) #define NULLFILE (&myio_null) der Mouse (mouse@mcgill-vision.uucp)