select: make Curl_socket_check take timediff_t timeout#5240
select: make Curl_socket_check take timediff_t timeout#5240
Conversation
|
The same condition check would need to be applied to And I am preparing a PR to make the functions in |
|
Sounds like a good move! I'll pause this PR then and we can close it again once your work lands. |
|
Then I will also hold off a fix for two |
|
I think we should ignore the analyzer in this case. Any compiler can optimize it away as is. |
|
I agree that it is a totally harmless detail, but I think this code also risk causing compiler warnings so I still think we should take care of it. |
Coverity found CID 1461718: Integer handling issues (CONSTANT_EXPRESSION_RESULT) "timeout_ms > 9223372036854775807L" is always false regardless of the values of its operands. This occurs as the logical second operand of "||".
3186b4c to
a78bb56
Compare
|
I just want to add that this is meant to primarily address the problem Coverity detected before the pending release, it is not a replacement of #5262. |
Make all functions in select.[ch] take timeout_ms as timediff_t which should always be large enough and signed on all platforms to take all possible timeout values and avoid type conversions. Reviewed-by: Jay Satiro Reviewed-by: Daniel Stenberg Replaces #5107 and partially #5262 Related to #5240 and #5286 Closes #5343
Coverity found CID 1461718:
Integer handling issues (CONSTANT_EXPRESSION_RESULT) "timeout_ms >
9223372036854775807L" is always false regardless of the values of its
operands. This occurs as the logical second operand of "||".