🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c
Article #403

Re: (char *)(-1)

#403
From: R. Vuurboom
Date: Tue, 01 Aug 1989 19:01
33 lines
2061 bytes
|In article <617@prles2.UUCP| meulenbr@cstw01.prl.philips.nl (Frans Meulenbroeks) writes:
|
|I agree that (char *) -1 could be a valid pointer.
|However the chances that it will be are so incredibly small that I for me
|would safely ignore this.
|
|Consider the following:
|If your system uses 2-s complement (most systems do) -1 would refer to
|an address with all 1-s (e.g. 0xffffffff on a 32 bit system).
|That is the very last address in the systems address space.
|So (assuming 2-s complement) (char *) -1 can only be a valid
|pointer if the following conditions are satisfied:
|- there is memory on the last address in the system
|  (not likely in the case of memory mapped I/O. Also not likely in 
|   the case of 32 bit addresses, since this requires an awful lot
|   of memory)

Well, Frans, consider the following:

I happen to have in front of me the Address Map for the support processor
on our top range computer: uses ff9xxxxx-fffxxxxx for (VME) A24 slave
access.

Our computer is already hardware ready for 1Gbyte and the memory doesn't
have to be contiguous. That means that the next generation is going to 
be 4 Gbyte.

-- 
I don't know what the question means, but the answer is yes...
KLM - Koninklijke Luchtvaart Maatschappij => coneenclicker lughtfart matscarpie
Roelof Vuurboom  SSP/V3   Philips TDS Apeldoorn, The Netherlands   +31 55 432226
domain: roelof@idca.tds.philips.nl             uucp:  ...!mcvax!philapd!roelof
Technical Details
Message-ID: <220@ssp1.idca.tds.philips.nl>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!mcvax!hp4nl!philapd!ssp1!roelof
References: <GEOFF.89Jun11231924@onyx.cs.warwick.ac.uk| <2619@yunexus.UUCP| <388@celit.UUCP| <118@psitech.UUCP| <1063@tukki.jyu.fi| <1282@cbnewsl.ATT.COM| <617@prles2.UUCP|

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!csd4.milw.wisc.edu!cs.utexas.edu!uunet!mcvax!hp4nl!philapd!ssp1!roelof
From: roelof@idca.tds.PHILIPS.nl (R. Vuurboom)
Newsgroups: comp.std.c
Subject: Re: (char *)(-1)
Keywords: pointers, casts
Message-ID: <220@ssp1.idca.tds.philips.nl>
Date: 1 Aug 89 19:01:25 GMT
References: <GEOFF.89Jun11231924@onyx.cs.warwick.ac.uk| <2619@yunexus.UUCP| <388@celit.UUCP| <118@psitech.UUCP| <1063@tukki.jyu.fi| <1282@cbnewsl.ATT.COM| <617@prles2.UUCP|
Organization: Philips Telecommunication and Data Systems, The Netherlands
Lines: 33