From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 32073 invoked from network); 6 Nov 2022 23:39:19 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 6 Nov 2022 23:39:19 -0000 Received: (qmail 31801 invoked by uid 550); 6 Nov 2022 23:39:17 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 31769 invoked from network); 6 Nov 2022 23:39:16 -0000 Date: Sun, 6 Nov 2022 18:39:04 -0500 From: Rich Felker To: Dmitry Bogatov Cc: bug-gsasl@gnu.org, musl@lists.openwall.com Message-ID: <20221106233904.GE29905@brightrain.aerifal.cx> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] Behaviour of strverscmp(3) On Sun, Nov 06, 2022 at 06:18:22PM -0500, Dmitry Bogatov wrote: > Hello. > > While trying to building gsasl statically with musl library as part of > Nixpkgs distribution, I noticed that test built from tests/version.c > fails when built with musl library. After a bit of troubleshooting, I > can pinpoint the reason -- different behaviour of "strverscmp" from > glibc and musl. > > Example code: > > #include > #include > > int main() > { > int value = strverscmp("UNKNOWN", "2.2.0"); > printf("%d\n", value); > return 0; > } > > Under glibc value "35" is printed (positive), under musl value "-1" is > printed (negative). Not sure what is the correct solution for the > issue, so I cross-post into two lists. > > For now I plan to patch-out this particular test. Thank you. It looks like we're neglecting to honor the exception case to "longer digit sequence is greater" when one of the sequences is degenerate (no digits). Rich