bin/71631: [PATCH] cleanup of the usr.sbin/pppctl code
Giorgos Keramidas
keramida at freebsd.org
Sun Sep 12 23:00:58 PDT 2004
The following reply was made to PR bin/71631; it has been noted by GNATS.
From: Giorgos Keramidas <keramida at freebsd.org>
To: Dan Lukes <dan at obluda.cz>
Cc: bug-followup at freebsd.org
Subject: Re: bin/71631: [PATCH] cleanup of the usr.sbin/pppctl code
Date: Mon, 13 Sep 2004 08:56:42 +0300
On 2004-09-13 03:11, Dan Lukes <dan at obluda.cz> wrote:
> On Sun, 12 Sep 2004, Giorgos Keramidas wrote:
> >>- int n, arg, fd, len, verbose, save_errno, hide1, hide1off, hide2;
> >>+ int n, arg, len, verbose, save_errno, hide1, hide1off, hide2;
> >>+ int fd = fd; /* init to avoid "might be used unitialized" warning 8/
> >
> >fd = -1; would be a better initialization, since no valid descriptor can
> >ever be negative and this will expose any bugs that using fd before a
> >proper initialization can trigger.
>
> But unnecesarry over-initialisation is waste of resources.
> It's about decision ...
Setting `int fd = fd' is also an initialiation that is a waste of
resources. I see no reason why it's better than an initialization
that also buys us some safety.
More information about the freebsd-bugs
mailing list