mirror of
https://sourceware.org/git/glibc.git
synced 2024-11-27 19:53:32 +08:00
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:
parent
6680738a18
commit
6ee3eab429
@ -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.
|
||||
|
||||
|
@ -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;
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user