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

2656-Daniel R. Levy00000000000 levy at mtcchi.uucp
Mon Jul 2 09:50:42 AEST 1990


peter at ficc.ferranti.com (Peter da Silva) writes:

>In article <16980 at haddock.ima.isc.com> karl at haddock.ima.isc.com (Karl Heuer) writes:
>> An ANSI-to-Classic conversion tool could do the job, but
>> I haven't heard of one that inserts the necessary casts.

>And it still wouldn't take care of

>	execl("/bin/foo", "foo", "bar", (char *)NULL);

Devil's advocate: why not?  All it has to know is that all arguments to
execl must be of type char *.  By adding some more elaborate smarts to the
converter, this could be extended to many other (but, granted, not literally
ALL) varargs functions.  And in the cases of the functions the converter could
not handle, it could warn the user to fix them up manually.
-- 
Daniel R. Levy
Memorex Telex Corporation
Naperville IL
..!uunet!tellab5!mtcchi!levy



More information about the Comp.lang.c mailing list