From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E4079385696B; Thu, 6 Jul 2023 21:59:46 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E4079385696B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1688680786; bh=8wyUci8LPQWE+7xn4q6lwLq6zp158etTi1axZkBVBvI=; h=From:To:Subject:Date:From; b=eVWX3J8KhklkPydHHg5OQ0dnY8wrfmVxx2dQn1TsQl496T8Zxq8202EGKwgdNEBnB Zo+1CJp3lNbByOtEddo9vxg3RacdicUzYnsq5+TA91yWqFhqbGX8i8ZatMTa0eZbKv ictlfy40jsztU6uEpA5Duds/Y4nw+WWQr5xrE8bw= From: "bruno at clisp dot org" To: glibc-bugs@sourceware.org Subject: [Bug string/30620] New: wcscmp bug on platforms with unsigned wchar_t Date: Thu, 06 Jul 2023 21:59:46 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: string X-Bugzilla-Version: 2.28 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: bruno at clisp dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D30620 Bug ID: 30620 Summary: wcscmp bug on platforms with unsigned wchar_t Product: glibc Version: 2.28 Status: UNCONFIRMED Severity: normal Priority: P2 Component: string Assignee: unassigned at sourceware dot org Reporter: bruno at clisp dot org Target Milestone: --- Created attachment 14956 --> https://sourceware.org/bugzilla/attachment.cgi?id=3D14956&action=3Ded= it test case testt-wcscmp.c When we have two wide-character strings such that wcscmp (input1, input2) <= 0, obviously we should have wcscmp (input2, input1) > 0. This is not the case = on glibc on platforms which have an unsigned 'wchar_t' type (such as aarch64). On platforms with a signed 'wchar_t' type (such as alpha), there is no prob= lem. How to reproduce: On a Linux/aarch64 machine, such as gcc185.fsffrance.org,= run the attached program: $ gcc test-wcscmp.c $ ./a.out=20 Expected behaviour: Successful termination. Actual behaviour: test-wcscmp.c:107: assertion 'wcscmp (input2, input1) > 0' failed Aborted (core dumped) The problematic source code appears to be in the file glibc/wcsmbs/wcscmp.c= . The function wcsncmp, OTOH, works fine. --=20 You are receiving this mail because: You are on the CC list for the bug.=