Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!rutgers!clyde!cuae2!ltuxa!ttrdc!levy From: levy@ttrdc.UUCP (Daniel R. Levy) Newsgroups: net.lang.c Subject: Re: absolute pointer Message-ID: <1285@ttrdc.UUCP> Date: Sat, 1-Nov-86 18:57:36 EST Article-I.D.: ttrdc.1285 Posted: Sat Nov 1 18:57:36 1986 Date-Received: Tue, 4-Nov-86 06:09:07 EST References: <7267@utzoo.UUCP> Organization: AT&T, Computer Systems Division, Skokie, IL Lines: 28 In article <7267@utzoo.UUCP>, henry@utzoo.UUCP (Henry Spencer) writes: >> rap.c, line 310: warning: absolute pointer used >> >> if ( shmaddr EQ (char *) -1 ) { > >The compiler is trying to warn you, in a somewhat cryptic way, that casting >any integer except the constant 0 into a pointer is a machine-dependent, >unportable, and dangerous operation. >-- > Henry Spencer @ U of Toronto Zoology > {allegra,ihnp4,decvax,pyramid}!utzoo!henry However, in SysV the shmat(2) call returns (char *) -1 in case of error. I'll bet a doughnut that this is where shmaddr is coming from. Is anyone aware of any computer where this would not work as intended (thus, couldn't support full SysV)? It could be argued that NULL (i.e., 0, with its already agreed-upon special-caseness) would have been better (more portable?) but it's too late now and I've never heard where it hurt anyone either. -- ------------------------------- Disclaimer: The views contained herein are | dan levy | yvel nad | my own and are not at all those of my em- | an engihacker @ | ployer or the administrator of any computer | at&t computer systems division | upon which I may hack. | skokie, illinois | -------------------------------- Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa, go for it! allegra,ulysses,vax135}!ttrdc!levy