bin/71628: [PATCH] cleanup of the usr.sbin/rpcbind code

Giorgos Keramidas keramida at
Sun Sep 12 23:00:49 PDT 2004

The following reply was made to PR bin/71628; it has been noted by GNATS.

From: Giorgos Keramidas <keramida at>
To: Dan Lukes <dan at>
Cc: alfred at, bug-followup at
Subject: Re: bin/71628: [PATCH] cleanup of the usr.sbin/rpcbind code
Date: Mon, 13 Sep 2004 08:49:07 +0300

 On 2004-09-13 02:57, Dan Lukes <dan at> wrote:
 >On Sun, 12 Sep 2004, Giorgos Keramidas wrote:
 >> After a quick glance at the source of rpcbind() I think that there's
 >> no way that my_xrpt can be used uninitialized.  A proper fix for this
 >> warning would be then to just set my_xrpt to NULL at first and let
 >> the rest of the function unchanged regarding my_xrpt.
 > 	The unnecesarry initialisation of variable initialised again later
 > seems to be vaste of resources. But IMHO only.
 True, but this is not the case here.  If you do initialize the value of
 my_xrpt to something (i.e. to whatever value happens to be held in
 my_xrpt at the time execution reaches the point of its declaration),
 you should at least set it to something that is Right(TM).
 This initialization
 	char *foo = foo;
 is not cheaper than this one:
 	char *foo = NULL;
 so if you're going to pay the penalty of initializing a variable to
 shuttup the compiler, the second is preferrable because it explicitly
 sets the pointer to a value that cannot be dereferenced.  This will
 catch possible bugs (current or future) in the rest of the code, so
 it's a lot safer.

More information about the freebsd-bugs mailing list