automatic initialization to 0

Henry Spencer henry at utzoo.UUCP
Sun Jul 17 11:15:42 AEST 1983


	If you're writing C code for an operating system-less microprocessor
	(i.e. .text and .data in ROM, .bss in RAM), your .bss stuff generally
	won't get initialized to 0.  And, of course, you'll only want to put
	constants into .data because it's hard to change ROM.

If it doesn't initialize .bss to 0, it does not comply with the C reference
manual and therefore is not C.  Such a botch will also break many programs
(probably not relevant for this case) and many library functions (rather
more serious).  Putting all initialized variables in ROM is also wrong,
for the same reasons.  I appreciate the problems involved in figuring out
which things go in ROM and which in RAM, but this is the wrong way to
tackle it.
-- 
				Henry Spencer
				U of Toronto
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list