https://bugs.winehq.org/show_bug.cgi?id=50059
Bug ID: 50059 Summary: compilation error with gcc 8.3.0 unsigned int -> long unsigned int Product: Wine Version: 5.0.2 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs@winehq.org Reporter: eserradi@gmx.com Distribution: ---
Created attachment 68517 --> https://bugs.winehq.org/attachment.cgi?id=68517 "long unsigned int" instead of "unsigned int"
compiling wine 5.0.2 (and 5.0.1) with gcc version 8.3.0 (Debian 8.3.0-6) gives the error:
d3d9_main.c:154:5: note: in expansion of macro ‘FIXME’ FIXME("iface %p, callback %p, context %p, arg3 %#Ix, stub!\n", iface, callback, context, arg3); ^~~~~ d3d9_main.c:154:11: error: format ‘%x’ expects argument of type ‘unsigned int’, but argument 8 has type ‘DWORD_PTR’ {aka ‘long unsigned int’} [-Werror=format=]
the attached patch fixes the problem in my case
https://bugs.winehq.org/show_bug.cgi?id=50059
François Gouget fgouget@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |fgouget@codeweavers.com Keywords| |patch
--- Comment #1 from François Gouget fgouget@codeweavers.com --- I believe it would be better to avoid printing this type of 'variable size' int to avoid all these compiler compatibility issues. Note also that this is not the only place where '%#Ix' is used (see dlls/atl/atl_ax.c, dlls/kernelbase/process.c, dlls/quartz/vmr9.c, etc).
Maybe something like this?
- WARN("iface %p, callback %p, context %p, arg3 %#Ix, stub!\n", iface, callback, context, arg3); + WARN("iface %p, callback %p, context %p, arg3 %p, stub!\n", iface, callback, context, (void*)arg3);
https://bugs.winehq.org/show_bug.cgi?id=50059
--- Comment #2 from François Gouget fgouget@codeweavers.com --- Also this is not an issue when compiling with MinGW (8.3) which is the preferred path on Linux (such as Debian).
https://bugs.winehq.org/show_bug.cgi?id=50059
--- Comment #3 from eserradi@gmx.com --- current version on debian (https://packages.debian.org/sid/wine) explicitly disables mingw when building from source (--without-mingw) and uses gcc for x86-64 architectures
https://bugs.winehq.org/show_bug.cgi?id=50059
--- Comment #4 from François Gouget fgouget@codeweavers.com --- The Debian package should really not be disabling MinGW. But fortunately the unstable version seems to have fixed that. https://www.winehq.org/pipermail/wine-devel/2021-July/191488.html
https://bugs.winehq.org/show_bug.cgi?id=50059
--- Comment #5 from eserradi@gmx.com --- ok very good, in any case, the proposed patch or your solution might work for both mingw and gcc, IMO it is not a good idea to leave it as it is as the error is clear unless that is intended but then it should be cast explicitly to 'unsigned int'