What machines core dump on deref of NULL?

Rich Salz rsalz at bbn.com
Wed Jun 27 23:58:24 AEST 1990


In <2392 at aix.aix.kingston.ibm.com> rlc at aix.aix.kingston.ibm.com (Roger Collins) writes:
|To give another example of this situation, almost all UNIX systems
|initialize .bss to zero.  This causes uninitialized global and static
|variables to be initialized to zero by default.  Many, many programs,
|including System V commands, depend on this fact.  They assume
|uninitialized global and static variables are initialized to zero
|even though the C language explicitly says the values are undetermined.

This is totally and completely wrong.

Static data is guaranteed to be initialized to zero.  See, for example, K&R
2nd edition, page 219 and page 86.

Gee, I hope you're not in the compiler or OS group. :-)

Followups to comp.lang.c
	/r$
-- 
Please send comp.sources.unix-related mail to rsalz at uunet.uu.net.
Use a domain-based address or give alternate paths, or you may lose out.



More information about the Comp.unix.wizards mailing list