public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* wmemset() regression with 3.4.2
@ 2022-12-15 19:04 Christoph Reiter
  2022-12-15 19:55 ` Christoph Reiter
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Reiter @ 2022-12-15 19:04 UTC (permalink / raw)
  To: cygwin

The following example works with 3.3.6, but fails with 3.4.2. It's a
reduced example from pacman which started to produce garbage output in
some places after upgrading to 3.4.2. While I noticed it in MSYS2
first, I have confirmed it with 3.3.6 and 3.4.2 in cygwin.

```
#include <wchar.h>
#include <stdlib.h>
#include <stdio.h>

int main()
{
    char dest[50] = { 0 };
    wchar_t src[] = L"example";
    wmemset(src, L'E', 1);
    if (wcstombs(dest, src, 7) == -1) {
        printf("FAILED\n");
        return 1;
    }
    printf("OK: %s\n", dest);
    return 0;
}
```

thanks

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

* Re: wmemset() regression with 3.4.2
  2022-12-15 19:04 wmemset() regression with 3.4.2 Christoph Reiter
@ 2022-12-15 19:55 ` Christoph Reiter
  2022-12-16 13:20   ` Jon Turney
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Reiter @ 2022-12-15 19:55 UTC (permalink / raw)
  To: cygwin

I can confirm that reverting the asm change in
https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=188d5f6c9ad5cbbd6f0fcb9aaf15bc9870597910
seems to make things work again.

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

* Re: wmemset() regression with 3.4.2
  2022-12-15 19:55 ` Christoph Reiter
@ 2022-12-16 13:20   ` Jon Turney
  0 siblings, 0 replies; 3+ messages in thread
From: Jon Turney @ 2022-12-16 13:20 UTC (permalink / raw)
  To: Christoph Reiter, The Cygwin Mailing List

On 15/12/2022 19:55, Christoph Reiter via Cygwin wrote:
> I can confirm that reverting the asm change in
> https://cygwin.com/git/?p=newlib-cygwin.git;a=commit;h=188d5f6c9ad5cbbd6f0fcb9aaf15bc9870597910
> seems to make things work again.
> 

Thanks.

That seems like a thinko.  The size of c (the set value) is also 
different between memset() and wmemset().

I've uploaded a 3.4.3 with that change reverted.


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

end of thread, other threads:[~2022-12-16 13:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-15 19:04 wmemset() regression with 3.4.2 Christoph Reiter
2022-12-15 19:55 ` Christoph Reiter
2022-12-16 13:20   ` Jon Turney

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).