RFR 8203369 : Check for both EAGAIN and EWOULDBLOCK error codes
Weijun Wang
weijun.wang at oracle.com
Fri May 25 05:25:35 UTC 2018
https://stackoverflow.com/questions/27509061/macro-to-avoid-duplicate-case-value
Someone has already used them in a switch expression...
> On May 25, 2018, at 12:45 PM, David Holmes <david.holmes at oracle.com> wrote:
>
>>> I also wonder whether a smart compiler might not flag code where the errors do infact have the same value:
>>>
>>> if (errno == 11 || errno == 11) ...
>>>
>> At least gcc -O completely removes the second redundant test, so no observable changes is expected on supported platforms.
>
> I'm more worried about a new compiler warning - especially if you happened to use them in a switch! - resulting in future build failures.
More information about the nio-dev
mailing list