🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by Henry Spencer Fri, 31 Oct 1986 00:51
Re: absolute pointer
#9677
Author: Henry Spencer
Date: Fri, 31 Oct 1986 00:51
10 lines
823 bytes
> 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
Re: absolute pointer
#9707
Author: Daniel R. Levy
Date: Sat, 01 Nov 1986 23:57
28 lines
1873 bytes
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
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads