NULL vs 0

edhall%rand-unix at sri-unix.UUCP edhall%rand-unix at sri-unix.UUCP
Sun Feb 5 00:16:00 AEST 1984


From:  Ed_Hall <edhall at rand-unix>

Before another insomniac flames me on it, let me state that my `solution'
for the null-pointer argument problem assumes that a constant zero and
a pointer otherwise match as arguments (e.g. are the same width).
Obviously, this need not be so (such as 16-bit int's and 32-bit pointers,
for a common example).

Let's cloud the issue more by insisting that all parameters be the
same (maximum) width.  Such consistancy has other benifits, though
there obviously can be an efficiency penalty.

All I am trying to do is show that even an admittedly faulty language
feature (the inability to declare function parameters apart from the
function definition) can be worked around if the compiler designer
is willing to go through enough contortions.

Happily, it appears that the ANSI standards committee is considering
a reasonable means (in my opinion) for declaring function parameter
types in an external declaration.

		-Ed



More information about the Comp.unix.wizards mailing list