Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!cs.utexas.edu!uunet!mcvax!ukc!stl!stc!jed!graham From: graham@jed.tcom.stc.co.uk (Graham Bardsley) Newsgroups: comp.std.c Subject: Re: (char *)(-1) Keywords: pointers, casts Message-ID: <1661@bute.tcom.stc.co.uk> Date: 1 Aug 89 17:24:19 GMT References: <2619@yunexus.UUCP> <18792@mimsy.UUCP> <120@psitech.UUCP> <10637@smoke.BRL.MIL> Sender: news@tcom.stc.co.uk Reply-To: graham@tcom.stc.co.uk (Graham Bardsley) Organization: STC Telecoms, New Southgate, London, England Lines: 21 Here's some other sloppyness in UNIX pointer types (by no means definative): caddr_t mmap() returns -1 on error char *shmat() returns -1 on error. void (*signal())() can return either -1 (error), 0 (SIG_DFL), or 1 (SIG_IGN) although SIG_DFL and SIG_IGN are macros :-o char *mktemp() returns -1 on error Just what are you meant to to test error conditions with these beasts ! The only thing really is to cast the result to int and compare but thats still not portable and some lints will not shut up about such things (even if you tell them to). ---- Graham Bardsley,STC Telecoms,Oakleigh Road South,New Southgate, London, N11 1HB ..{mcvax}!ukc!stc!graham Tel: +44 1 368 1234 x2739