This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Even if we look through macros, I'd actually think we should warn here.
Because this is actually:
#define EAGAIN 11
#define EWOULDBLOCK EAGAIN
extern int *__errno_location (void) __attribute__ ((__nothrow__, __leaf__,
__const__));
#define errno (*__errno_location ())

int
foo ()
{
  if (errno == EAGAIN || errno == EWOULDBLOCK)
    return 1;
  return 0;
}
and even errno.h claims that EWOULDBLOCK is EAGAIN.
The warning on this started with r222408.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]