Ping - old patch from April - mingw support for I32/I64 MS printf formatters to c-format.c

Joseph S. Myers
Tue Dec 18 16:30:00 GMT 2007

On Tue, 18 Dec 2007, Kai Tietz wrote:

> I added updated the patch against current head version of gcc and add a 
> test-case for the common case that the system (crt) version of formatter 
> is used. For mingw targets there is no %lld formatter existing. Instead MS 
> functions are using %I64d and %I64d. This patch additionally allows the 
> user to define a alternative formatter beside the system one for i386 
> targets. The default formatters are named "gnu_*" and the MS specific 
> "ms_*".
> This patch is tested for *-pc-mingw32 (using MS %I32 and %I64) and for 
> i686-pc-cygwin (for the gnu variant).

The new test needs to go in gcc.dg/format, and where possible tests should 
use format.h.  In addition to testing the new Windows format, you need to 
test that all the standard and GNU features not supported by Windows 
receive proper diagnostics.

Did you really get clean test results for all the existing testcases in 
gcc.dg/format on MinGW?  Since they use system functions such as printf, 
I'd have expected many failures as they test features not supported by 
Windows.  This would require appropriate arrangements for the functions to 
be declared with the gnu_* attributes on Windows, or to be mapped with 
#define to functions so declared (as the minimal change to keep the tests 
working) for most tests, with separate Windows-only tests that appropriate 
features are accepted and rejected for the system and ms_ formats.

Does the set of format features supported on Windows depend at all on the 
version of Windows?  If so, for what version of Windows did you prepare 
the tables of supported features?

Joseph S. Myers

More information about the Gcc-patches mailing list