strverscmp is buggy in Cygwin 3.4.6

Bruno Haible bruno@clisp.org
Tue Jan 2 10:23:26 GMT 2024


Hi,

Here's a test case of strverscmp, from Dmitry Bogatov [1]

#include <string.h>
int main ()
{
  return strverscmp ("UNKNOWN", "2.2.0") <= 0;
}

It succeeds on glibc and musl libc 1.2.4, but fails on musl libc 1.2.3
and Cygwin 2.9.0 and 3.4.6.

The cause is apparently that Cygwin's strverscmp implementation was
borrowed from musl libc (Cygwin commit 59e09b6419cdf400be3c73b61ac9c22560dc397e)
at a time when musl libc's implementation was buggy. In musl libc, it is
meanwhile fixed, through
https://git.musl-libc.org/cgit/musl/commit/src/string/strverscmp.c?id=b50eb8c36c20f967bd0ed70c0b0db38a450886ba

Bruno

[1] https://lists.gnu.org/archive/html/bug-gnulib/2024-01/msg00002.html





More information about the Cygwin mailing list