Must a NULL pointer be a 0 bit patte

Henry Spencer henry at utzoo.UUCP
Tue Nov 6 10:02:50 AEST 1984


> Aside from the case of BSS initialization, which one could argue is equivalent
> to an assignment so the compiler can handle pointers by initializing them
> (good luck to people who depend on these variables really going into .bss),
> there is calloc and memset(&structure, '\0', sizeof structure); these
> would have to be changed to explicit member-by-member assignment,
> or assignment from a dummy previously initialized structure.

People who depend on specific variables really going into .bss are
writing grossly unportable code -- the whole *notion* of .bss is quite
implementation-dependent -- so I feel no sympathy for them.

calloc() is admittedly problematic, but one can argue that the definition
of calloc() is such that it is unimplementable on oddball machines.  That
is, the definition of calloc() is subtly machine-dependent.  Viewed in this
light, calloc() is a lesser issue.  Ditto for memset(), whatever in the
world that is.
-- 
				Henry Spencer @ U of Toronto Zoology
				{allegra,ihnp4,linus,decvax}!utzoo!henry



More information about the Comp.lang.c mailing list