[PATCH 2/2] msvcrt/tests: Work around sscanf("%hhd") not working yet.

Serge Gautherie winehq-git_serge_180711 at gautherie.fr
Sat Nov 2 22:35:49 CDT 2019

On 03/11/2019 04:02, Zebediah Figura wrote:

> On 11/2/19 9:51 PM, Serge Gautherie wrote:

>> The only correct result is 0xdeadbe4e, as in dlls/ucrtbase/tests/scanf.c,
>> but test fails on Windows/ReactOS too, until Wine code is fixed...
> Where are you getting this? The test seems to pass on all of our VMs:

It passes because 0x00bc614e is wrong.
With correct value, it fails everywhere:

I compiled this test snippet alone on GCC (probably Linux) and got the 
correct value.

> Note that ucrtbase and msvcrt behave differently here; msvcrt's scanf()
> can't change its behaviour due to backwards-compatibility.

I saw "hh" support is new in C99, compared to C90.
Do you mean overflowing is a wanted (Windows) legacy bug?
Or should trying to use "hh" cause an explicit warning/error instead?
At the very least, current wrong behavior should be "documented", as my 
patch somewhat does anyway.

I am not sure if/how you want to "fix" this, but corrupting memory feels 
rather bad to me...


More information about the wine-devel mailing list