NULL vs 0

crl at CS-Mordred.UUCP crl at CS-Mordred.UUCP
Sat Jan 21 01:39:50 AEST 1984


What makes a program portable?  Adhering strictly to the C reference
manual is the answer I'd give.  Since the manual states that 0 == NULL,
I believe that's that.  It is up to the implementation to assure that
this works.  If I came along with a machine and implementation that
disallowed some other construct, like *i++, for example, I know for a 
fact that everyone would scream at how ``I'' should change, and not how
``C'' should be modified.

Offhand, I could not find anything in the manual that says that function
arguments on the stack are no smaller than type int.  (I could have
easily overlooked this, however.)  Couldn't machines with 32 bit pointers
and 16 bit ints push 32 bits on the stack always.  This is analogous to
how chars are done now.

Charles LaBrec
UUCP:		pur-ee!Physics:crl, purdue!Physics:crl
INTERNET:	crl @ pur-phy.UUCP



More information about the Comp.unix.wizards mailing list