These used to be necessary but now that NULL is (void *)0 they
aren't.
I'd be inclined to keep them anyway - with the cast it is clearly not a
bug, without is not so clear. There are also loads of them and it'd be a
lot of churn to fix them all, for no real advantage. But I don't feel
strongly about it, others may disagree.
On Mon, Sep 14, 2015 at 09:39:48AM -0400, Michael McConville wrote:
> Index: mv.c
> ===================================================================
> RCS file: /cvs/src/bin/mv/mv.c,v
> retrieving revision 1.40
> diff -u -p -r1.40 mv.c
> --- mv.c 24 Aug 2015 00:10:59 -0000 1.40
> +++ mv.c 14 Sep 2015 13:38:13 -0000
> @@ -348,7 +348,7 @@ copy(char *from, char *to)
> pid_t pid;
>
> if ((pid = vfork()) == 0) {
> - execl(_PATH_CP, "cp", "-PRp", "--", from, to, (char *)NULL);
> + execl(_PATH_CP, "cp", "-PRp", "--", from, to, NULL);
> warn("%s", _PATH_CP);
> _exit(1);
> }
> @@ -366,7 +366,7 @@ copy(char *from, char *to)
> return (1);
> }
> if (!(pid = vfork())) {
> - execl(_PATH_RM, "cp", "-rf", "--", from, (char *)NULL);
> + execl(_PATH_RM, "cp", "-rf", "--", from, NULL);
> warn("%s", _PATH_RM);
> _exit(1);
> }
>