http://bugs.winehq.org/show_bug.cgi?id=10401
Summary: cygwin programs don't sscanf() properly when -mno-cygwin is used in gcc options Product: Wine Version: 0.9.49. Platform: PC-x86-64 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: wine-misc AssignedTo: wine-bugs@winehq.org ReportedBy: emwine@earthlink.net
Created an attachment (id=9089) --> (http://bugs.winehq.org/attachment.cgi?id=9089) testcase project and 2 test binaries
When I upgraded to Winboard version 4.2.7b from 4.2.7a, I got parse errors when the app tried to extract info from an online chess server. I tracked this down as far as I am able-- it appears to be only a definition in the makefile: -mno-cygwin. How that causes the bug, I don't understand, but presumably the only difference between Winboard 4.2.7b and 4.2.7a (which works in wine) is the presence of that option in the makefile.
When -mno-cygwin is present, a call like:
n=sscanf("r-bqk -1 0", "%5c%d%d", str, &i, &j);
only gets the first character into str rather than all 5 like it should, and n becomes 1 with i and j failing to get read.
Attached is a testcase project to illustrate. It includes 2 binaries, the only difference being the presence of -mno-cygwin during the build. (Line 19 in the makefile) To build this testcase, you need the cygwin tools, probably just normal build tools, and to run wbtest.exe, you need cygwin1.dll which I haven't included.
wbtest-nocyg.exe: works properly in wine and in windows
wbtest.exe: works properly in windows, but fails in wine