Subject: Re: bin/7592: programs' error handle broken by good intentions
To: NetBSD GNATS submissions and followups <gnats-bugs@gnats.netbsd.org>
From: Lennart Augustsson <lennart@augustsson.net>
List: netbsd-bugs
Date: 05/26/1999 11:10:50
"Greg A. Woods" wrote:

> This is unfortunate because it's still possible to call a function
> without a prototype declaration in scope (i.e. within the definition of
> the language), and passing zero as a parameter to such a function
> expecting a pointer will potentially cause problems because this
> automatic cast which might in fact widen the representation of zero to
> something of greater rank than an ordinary 'int' will be missing

If you pass 0 or NULL in a function call where there is no prototype
in scope you can loose equally bad.  On some platforms pointers to
different types may have different sizes so if you don't know the type
of the pointer you're casting to then you'll fail.
So function calls without a prototype should be banned. :-)  And then 0
is as good as NULL.

--

        -- Lennart