[Bug c/69602] [6/7 Regression] over-ambitious logical-op warning on EAGAIN vs EWOULDBLOCK

msebor at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jan 24 21:30:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602

Martin Sebor <msebor at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |msebor at gcc dot gnu.org

--- Comment #14 from Martin Sebor <msebor at gcc dot gnu.org> ---
I would suggest to keep the warning simple and avoid overdesigning it with
workarounds for this case.  The solution in comment #12 (copied below) seems
like a good approach for avoiding the duplication and the warning.  It's
already commonly used to deal with non-standard implementation-specific macros
that portable programs cannot otherwise rely on.

        1149        if (   cchRead < 0 
        1150            && (   errno == EAGAIN 
        1151    #if EAGAIN != EWOULDBLOCK 
        1152                || errno == EWOULDBLOCK 
        1153    #endif 
        1154                ))


More information about the Gcc-bugs mailing list