[Bug 14393] New: atoi() implemenation on large integers is wrong
http://bugs.winehq.org/show_bug.cgi?id=14393 Summary: atoi() implemenation on large integers is wrong Product: Wine Version: 1.1.0 Platform: Other OS/Version: other Status: UNCONFIRMED Severity: minor Priority: P2 Component: -unknown AssignedTo: wine-bugs(a)winehq.org ReportedBy: shino(a)jenux.homelinux.org CC: shino(a)jenux.homelinux.org Created an attachment (id=14706) --> (http://bugs.winehq.org/attachment.cgi?id=14706) demonstration of the wrong behaviour This bug has been mentioned on the wine mailinglist: http://www.winehq.org/pipermail/wine-devel/2004-May/027187.html If you give atoi a string of an unsigned integer (>2^31) the wine implementation gives a strange result (apparently alway the same integer). The GNU-libc and the windows implementation gives the correct, unsigned integer. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=14393 --- Comment #1 from Lei Zhang <thestig(a)google.com> 2008-07-15 18:17:14 --- gcc produces the wrong result here: $ uname -m i686 $ gcc --version gcc (GCC) 4.0.3 (Ubuntu 4.0.3-1ubuntu5) $ gcc foo.c $ ./a.out 127.255.255.255 2147483647 -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=14393 --- Comment #2 from Joël Bohnes <shino(a)jenux.homelinux.org> 2008-07-15 20:29:48 --- Ok this is strange - it works on my 64bit systems but doesn't work on 32bit.. so you mustn't use atoi() on strings representing integers > INT_MAX. Anyway, mingw&wine gives other results than mingw&windows - it may cause hard-to-find bugs if applications rely on the windows-specific behaviour. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=14393 --- Comment #3 from Lei Zhang <thestig(a)google.com> 2008-07-17 16:50:42 --- I compiled with gcc with cygwin on 32-bit Windows XP, and I get the same results as 32-but Ubuntu. Are you testing on 64-bit Windows as well? -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=14393 --- Comment #4 from Joël Bohnes <shino(a)jenux.homelinux.org> 2008-07-17 18:45:45 --- Well that's why cygwin is there - to get the same results as under linux. The executable you built uses glibc and therefore you get this result. Your application won't run without cygwin, or at least, without the 'cygwin.dll'. You can tell gcc that you don't want to build a cygwin exectuable but a native windows appliction by adding the '-mno-cygwin' parameter. So compile the source like this: 'gcc foo.c -mno-cygwin -lwsock32', run the resulting exe and you'll see the difference. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=14393 Lei Zhang <thestig(a)google.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1 --- Comment #5 from Lei Zhang <thestig(a)google.com> 2008-07-18 19:27:56 --- Right, patch sent: http://article.gmane.org/gmane.comp.emulators.wine.patches/54466 -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=14393 Lei Zhang <thestig(a)google.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #6 from Lei Zhang <thestig(a)google.com> 2008-07-22 12:07:19 --- Patch committed, marking this fixed. http://www.winehq.org/pipermail/wine-cvs/2008-July/045681.html -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=14393 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #7 from Alexandre Julliard <julliard(a)winehq.org> 2008-07-25 13:22:59 --- Closing bugs fixed in 1.1.2. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org