Thread (5 messages) flat view 5 messages, 3 authors, 2015-12-18

Re: [PATCH iproute2] ip, route: fix minor compile warning

From: Daniel Borkmann <daniel@iogearbox.net>
Date: 2015-12-14 15:53:23

On 12/14/2015 04:51 PM, Phil Sutter wrote:
On Mon, Dec 14, 2015 at 04:34:29PM +0100, Daniel Borkmann wrote:
quoted
Seems like gcc (4.8.3) doesn't catch this false positive, triggering
after 0f7543322c5f ("route: ignore RTAX_HOPLIMIT of value -1"):

   iproute.c: In function 'print_route':
   iproute.c:301:12: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized]
      features &= ~RTAX_FEATURE_ECN;
               ^
   iproute.c:575:10: note: 'val' was declared here
       __u32 val;
             ^
So just shut it up by initializing to 0.
Hmm. Interestingly, my patch shouldn't have changed anything relevant
for gcc's decision. OTOH, I don't see a warning using gcc-4.9.3.
If I revert it, the warning is gone for me ;) perhaps some heuristic issue
with that gcc version.

Cheers,
Daniel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help