[Bug c/69602] [6/7 Regression] over-ambitious logical-op warning on EAGAIN vs EWOULDBLOCK
manu at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jan 26 23:52:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602
--- Comment #17 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
(In reply to Martin Sebor from comment #16)
> There are straightforward ways to avoid interspersing code with preprocessor
> conditionals:
Will GCC adopt this approach so that the warning can be enabled with -Wextra?
Because the reason it was moved out of -Wextra was due to warning for this type
of code in GCC itself.
> Marek and Jakub will likely have an idea of how common it is
> once they rebuild Fedora with GCC 7. If you have data of your own that
> might be helpful as well.
Most people use just "-Wall -Wextra". This warning needs to be enabled
explicitly, so I doubt many programs use it. The reason is precisely these
false positives. Well, at least PR61534.
A similar case is:
static const int EWOULDBLOCK = 1;
static const int EAGAIN = 1;
int errno;
int foo(void) {
if (errno == EAGAIN || errno == EWOULDBLOCK)
return 1;
return 0;
}
for which we also warn but I honestly think we should not.
More information about the Gcc-bugs
mailing list