Re: [PATCH 19/28] verbs: Avoid gcc 6.1 warning -Wunused-variable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Sep 14, 2016 at 07:46:15PM +0300, Yishai Hadas wrote:
> On 9/6/2016 12:08 AM, Jason Gunthorpe wrote:
> >gcc remarks:
> >
> >../libibverbs/src/neigh.c:339:6: warning: 'sock_fd' may be used uninitialized in this function [-Wmaybe-uninitialized]
> >  err = try_send_to(sock_fd, buff, sizeof(buff), &addr_dst);
> 
> 
> Why not just initializing 'sock_fd' to any value (e.g. to 0) when it's
> declared and drop all below patch ? as the code checks the return code from
> create_socket() it should be safe.

Because that is a lazy fix. This code is full of cruft computing an
error value that is never used. There is no reason to do that so the
best approach is to remove the dead code cruft.

Jason
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux