Fix -Wmaybe-uninitialized warning in xdr.c

While we're at fixing build warnings, here's one unnecessary warning
that can be fixed fairly easily.  The SIZE variable is never actually
use uninitialized, but the compiler cannot make that out and thinks
(correctly) that there is a potential for accessing SIZE without
initializing it.  Make this safe by initializing SIZE to 0.

Tested on x86_64.
This commit is contained in:
Siddhesh Poyarekar 2014-07-09 10:36:50 +05:30
parent 6680738a18
commit 6ee3eab429
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,7 @@
2014-07-09 Siddhesh Poyarekar <siddhesh@redhat.com>
* sunrpc/xdr.c (xdr_string): Initialize SIZE to 0.
* sysdeps/generic/unwind-pe.h: Only check if __cplusplus is
defined.

View File

@ -739,7 +739,7 @@ xdr_string (xdrs, cpp, maxsize)
u_int maxsize;
{
char *sp = *cpp; /* sp is the actual string pointer */
u_int size;
u_int size = 0;
u_int nodesize;
/*