Re: [PATCH] build: work around gcc 6.0 warnings

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

 



On Wed, Feb 24, 2016 at 02:29:58PM -0700, Eric Blake wrote:
> gcc 6.0 added an annoying warning:
> 
> 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) {
>                             ^~
> 
> This makes it impossible to build out-of-the-box on rawhide,
> and we aren't guaranteed that the gcc bug will be fixed in a
> timely manner:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602
> 
> So work around it by further complicating the logic to thwart the
> compiler.

Personally I don't like this approach.  Why don't we take that 6 line reproducer
from GCC BZ and create a m4 macro that will detect that bug in GCC and turn off
the logical-op check?  For me this solution is much cleaner than introducing
some ugly workaround in our code just because GCC has a bug.

Pavel

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]