https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69602
Gerald Pfeifer <gerald at pfeifer dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |gerald at pfeifer dot com --- Comment #10 from Gerald Pfeifer <gerald at pfeifer dot com> --- (In reply to Manuel López-Ibáñez from comment #6) > I think we should NOT look through macros. The purpose of the warning is to > catch mistakes like xxx && !!xxx or 0 < A || A > 0, but if the user writes > f() && g() and both functions return the same value, it is clearly not a > bug, even if GCC knows that they are the same function. I agree with Manuel (and had similar cases in Wine). Sometimes APIs may richer than an actual implementation thereof, as is the case in this example. Still we would want developers to write general code that matches the API instead of manually optimizing things (and in consequence breaking them on other platforms/in other scenarios). (In reply to Jakub Jelinek from comment #8) > if (errno == EAGAIN || (EWOULDBLOCK != EAGAIN && errno == EWOULDBLOCK)) > could be better workaround. This is WAY more complicated to read and understand than the original approach. I understand you only called it a workaround, but I am pretty sure both GCC and Wine maintainers (and presumably others) would shoot such obfuscation down if it's for the sake of avoiding a warning.