Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Value of a null pointer
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Brian T. Schellenberger  
View profile  
 More options Apr 29 1988, 12:13 am
Newsgroups: comp.lang.c
From: b...@sas.UUCP (Brian T. Schellenberger)
Date: 29 Apr 88 04:13:29 GMT
Local: Fri, Apr 29 1988 12:13 am
Subject: Re: Value of a null pointer
In article <11...@mimsy.UUCP> ch...@mimsy.UUCP (Chris Torek) writes:

|
|[lots of very well-stated true stuff deleted]
|I have heard of one, or perhaps two, efforts at writing compilers for
|machines on which the machine's preferred nil-pointer format was not an
|all zero bit pattern of some appropriate size.  The implementors ran
|into so much code that assumed otherwise that they finally gave in and
|did runtime conversions and tests, rather than using the hardware nil
|types.

We have code running on two such machines (DG & CDC).  On both, you can
zero out memory with your favorite fill function, and it will still work
just fine.  The first time an address register is loaded, it gets turned
into the real null-pointer if it used to be binary zero.  Then it is stored.

This means that the only things that screw you up are type-punning (using two
different pointers to the same memory) or incorrect use of unions (which is
really just language-supported type punning).  So you can assign or even stuff
a binary zero into a pointer place, but it may not still look the same if
you examine it in some peculiar way.

This approach allows most sloppy C code to work.
--
                                                         --Brian.
(Brian T. Schellenberger)                                ...!mcnc!rti!sas!bts

. . . now at 2400 baud, so maybe I'll stop bothering to flame long includes.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.