public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug string/30620] New: wcscmp bug on platforms with unsigned wchar_t
@ 2023-07-06 21:59 bruno at clisp dot org
  2023-07-06 22:00 ` [Bug string/30620] " bruno at clisp dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: bruno at clisp dot org @ 2023-07-06 21:59 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=30620

            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=14956&action=edit
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 problem.

How to reproduce: On a Linux/aarch64 machine, such as gcc185.fsffrance.org, run
the attached program:
$ gcc test-wcscmp.c
$ ./a.out 

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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-07-18 15:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-06 21:59 [Bug string/30620] New: wcscmp bug on platforms with unsigned wchar_t bruno at clisp dot org
2023-07-06 22:00 ` [Bug string/30620] " bruno at clisp dot org
2023-07-06 22:43 ` bruno at clisp dot org
2023-07-07  8:23 ` schwab@linux-m68k.org
2023-07-07  9:12 ` bruno at clisp dot org
2023-07-07  9:45 ` schwab@linux-m68k.org
2023-07-07 10:01 ` bruno at clisp dot org
2023-07-07 10:11 ` schwab@linux-m68k.org
2023-07-18 15:57 ` joseph at codesourcery dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).