Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: utzoo!henry
From: henry@utzoo.UUCP (Henry Spencer)
Newsgroups: net.lang.c
Subject: Re: Global ptrs init to NULL or 0000?
Message-ID: <6118@utzoo.UUCP>
Date: Mon, 4-Nov-85 20:21:23 EST
Article-I.D.: utzoo.6118
Posted: Mon Nov  4 20:21:23 1985
Date-Received: Mon, 4-Nov-85 20:21:23 EST
References: <772@whuxl.UUCP>
Organization: U of Toronto Zoology
Lines: 17

> ... in all the C compilers I know of, any uninitialized
> global/static is stuffed into the bss section and is set to all 0 bytes at
> run time...
> 
> So the big question is:  is it OK (portable, etc) to assume that declaring
> a global/static ptr without initialization will set it to the machine's
> idea of NULL, not all 0 bytes?  ...

That's the way things are supposed to work according to X3J11.  I would be
a little wary of assuming that things really *do* work that way on those
few machines that have non-0 NULLs, with current compilers.  I'd say the
assumption is all right in general, unless you are really being maximally
paranoid.  If you expect to have to port your software to such a machine
next month, some paranoia may be in order.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry