From: Viktor Szakats Date: Sat, 4 Apr 2026 00:14:30 +0000 (+0200) Subject: libssh: fix `-Wsign-compare` in 32-bit builds X-Git-Tag: curl-8_20_0~214 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=8c8eeba5225599a1f5750ece1d15751a8bfce0bb;p=thirdparty%2Fcurl.git libssh: fix `-Wsign-compare` in 32-bit builds Seen with mingw-w64 i686 gcc 15.2.0 (mingw32): ``` D:/a/curl/curl/lib/vssh/libssh.c: In function 'myssh_in_SFTP_QUOTE_STAT': D:/a/curl/curl/lib/vssh/libssh.c:1664:13: error: comparison of integer expressions of different signedness: 'time_t' {aka 'long int'} and 'unsigned int' [-Werror=sign-compare] 1664 | if(date > UINT_MAX) | ^ cc1.exe: all warnings being treated as errors ``` Ref: https://github.com/curl/curl/actions/runs/23966805891/job/69908216152 Cherry-picked from #21199 Closes #21214 --- diff --git a/lib/vssh/libssh.c b/lib/vssh/libssh.c index 06e1915951..f5ad541cd1 100644 --- a/lib/vssh/libssh.c +++ b/lib/vssh/libssh.c @@ -1661,7 +1661,7 @@ static int myssh_in_SFTP_QUOTE_STAT(struct Curl_easy *data, myssh_quote_error(data, sshc, NULL); return SSH_NO_ERROR; } - if(date > UINT_MAX) + if(date > (time_t)UINT_MAX) /* because the liubssh API cannot deal with a larger value */ date = UINT_MAX; if(!strncmp(cmd, "atime", 5))