Win64PrintfFormatWarnings

Win64PrintfFormatWarnings

See also Wine64.

Unfortunately Microsoft has choosen to keep on Win64 the C type long as a 32bit integer. The other 64bit OSes including Linux have long as a 64bit integer. This is a problem in so far that the Windows fundamental types DWORD/LONG/ULONG are bound to the long C type. Wine typedefs DWORD/LONG/ULONG as long for Win32 compiles and as int for Win64 compiles. But this produces _LOTS_ of printf format warnings when compiling Wine for Win64. The solution is to use int as typedef for DWORD/LONG/ULONG on Win32 compiles too. But this requires fixing the printf format warnings first.

How To Find Them

find . -name Makefile.in | xargs grep WINE_NO_LONG_AS_INT

(./) This task was finished on the 2006/12/20.

How To Fix Them

Use a Win32 Wine build; Wine won't even compile with _WIN64 defined (to fix that is an other task).

Remove WINE_NO_LONG_AS_INT from $dir/Makefile.in (also EXTRADEFS if that is empty after that).

make    # Recreate the Makefile
cd $dir
make clean
make 2>&1 | sort | uniq | fixformat.pl
# Check that there are no other warnings
make clean
make > /dev/null

Fix the format warnings that the fixformat.pl couldn't handle, cross-check the generated changes and submit the patch.

The fixformat.pl Script

[fixformat.pl] was written to automate as much as possible this janitorial task. At the start there were around 25000 unique printf format warnings; doing that by hand is a waste of developer time. fixformat.pl could automatically convert around 20500 of those warnings. A good part of the unhandled warnings are produced by macros and fixformat.pl cannot find a format string to fix. But that isn't that bad as manually fixing one of the macros will fix a lot of warnings.

fixformat.pl will also do a basic cleanup of the lines it modifies:

  • Trailing whitespace is removed.
  • Mixed tabs/space indentations are converted to spaces only.

"Hard" stuff

All the remaining directories aren't trivial to fix.


CategoryJanitorialProjects

Win64PrintfFormatWarnings (last edited 2008-12-20 10:51:49 by DanKegel)