Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Mon, 13 Oct 2014 18:20:51 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: wrong behaviour of 'strverscmp'

On Mon, Oct 13, 2014 at 12:58:10PM +0800, 黄建忠 wrote:
> Hi,
> 
> When I try to run some testcases, I found 'strverscmp' do not work like
> expected.
> 
> According to man page, 'Thus, the ordering is 000, 00, 01, 010, 09, 0,
> 1, 9, 10.'.
> 
> So the return value of strverscmp('000', '00) should less than zero, but
> musl return '0'-0(*l - *r), that is 48.

Confirmed that musl's strverscmp mismatches your expectations. Myself
and others think the expected behavior is ridiculous, but it's the
documented behavior and it's not very useful to provide an
implementation of a nonstandard function that doesn't match the one
present on systems that defined it, so this should be changed.

Of course we cannot use code from gnulib, though. I'll put fixing this
on the agenda and hopefully we can get it in the next release after
the upcoming 1.1.5 release. Thanks for the report.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.