[libvirt] Dealing with GCC 6.0

Martin Kletzander mkletzan at redhat.com
Mon Feb 1 14:37:07 UTC 2016


So we recently started compiling with gcc 5 and there's a new thing now
and we don't build on gcc 6.  I know it's just a development build, but
it finds new things, like:

fdstream.c: In function 'virFDStreamWrite':
fdstream.c:390:29: error: logical 'or' of equal expressions [-Werror=logical-op]
         if (errno == EAGAIN || errno == EWOULDBLOCK) {
                             ^~
fdstream.c: In function 'virFDStreamRead':
fdstream.c:440:29: error: logical 'or' of equal expressions [-Werror=logical-op]
         if (errno == EAGAIN || errno == EWOULDBLOCK) {
                             ^~

and

rpc/virnetsshsession.c: In function 'virNetSSHAuthenticateAgent':
rpc/virnetsshsession.c:548:56: error: logical 'and' of equal expressions [-Werror=logical-op]
         if (ret != LIBSSH2_ERROR_AUTHENTICATION_FAILED &&
                                                        ^~
rpc/virnetsshsession.c: In function 'virNetSSHAuthenticatePrivkey':
rpc/virnetsshsession.c:676:57: error: logical 'or' of equal expressions [-Werror=logical-op]
         if (ret == LIBSSH2_ERROR_PUBLICKEY_UNRECOGNIZED ||
                                                         ^~

The first one is prety easy to fix, that's the only place where we use
EWOULDBLOCK, we are using only EAGAIN everywhere else.  However, the
second one is not that easy to change for me as I'm not a libssh expert
and moreover, I would like to know other's opinions on how to tackle
that.  We can disable the logical-op warning, but it might show
something that makes sense (really?).  Or we can do bunch of very very
ugly "#if"s.

Anyone care to share an idea?

Have a nice day,
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20160201/4c51ee63/attachment-0001.sig>


More information about the libvir-list mailing list