Explicit cast of NULL (was Re: Short-circuiting conditions)

Martin Weitzel martin at mwtech.UUCP
Thu Jun 28 09:03:26 AEST 1990


In article <9473 at hubcap.clemson.edu> grimlok at hubcap.clemson.edu (Mike Percy) writes:
>martin at mwtech.UUCP (Martin Weitzel) writes:
[about explicit casts of NULL-pointers]

>>IMHO, if ANSI-C together with compilers that implement it *and*
>>function prototypes will be in broad use (1..3 years from now, I
>>suppose), explicit casts for NULL-pointers should become obsolete.
> 
>As near as I can tell, the need for explicit casts on NULL pointers _IS_
>obsolete.

Read careful what I wrote! You assume a compiler which implements
prototypes. Many people have to support code that must be compiled
with different compilers. Even if four out of five *have* prototypes,
you must explicitly cast NULL-pointer function arguments for the
the one that doesn't have them!

>Don't continue to propogate obsolete-isms.  Use prototyping
>utilities to fix old programs.  I've been using prototypes ever since my
>compiler (TurboC) supported them.  The sooner everyone starts using
>them, the sooner we can forget about the obsolete crap.

My point was not that prototypes should not be used, but simply
that at this time many compilers don't support them. It's true
that Turbo-C has prototypes for years now, but that doesn't help
if I have to compile on 386/ix, SINIX (don't worry if you don't
know that :-)), XENIX-286, ...
-- 
Martin Weitzel, email: martin at mwtech.UUCP, voice: 49-(0)6151-6 56 83



More information about the Comp.lang.c mailing list