NULL again

Chip Salzenberg chip at ateng.ateng.com
Wed Oct 5 02:24:15 AEST 1988


Gads, not another NULL argument.

According to davidsen at steinmetz.ge.com (William E. Davidsen Jr):
>| The computer's internal representation of a null pointer may not
>| be the same as the internal representation of the integer 0.
>
>  Just not true in the real world. There are hundreds of programs
>written by "all the world's a VAX" types who use NULL as a pointer
>(uncast) in procedure calls.

That's true but irrelevant.  THOSE PROGRAMS ARE NOT PORTABLE.  After all,
bitwise representation is not the only issue.  Sometimes pointers are
_larger_ than ints!

Please write this saying at the top of your terminal:

  +-----------------------------------------------------------------------+
  | Always cast the NULL pointer when it is used as a function parameter. |
  +-----------------------------------------------------------------------+

Followups to /dev/null, since that's where counter{flames,arguments} belong.
-- 
Chip Salzenberg             <chip at ateng.com> or <uunet!ateng!chip>
A T Engineering             Me?  Speak for my company?  Surely you jest!
	   Beware of programmers carrying screwdrivers.



More information about the Comp.sources.bugs mailing list