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

Danny Smith dansmister@gmail.com
Tue Dec 18 21:14:00 GMT 2007


Hello Kai

> This patch is tested for *-pc-mingw32 (using MS %I32 and %I64) and for
> i686-pc-cygwin (for the gnu variant).
>
> ChangeLog:
>
> 2007-12-18  Kai Tietz   <kai.tietz@onevision.com>
>
>         * gcc/doc/extend.texi: Extent user description.
>         * gcc/doc/tm.texi: (TARGET_OVERRIDES_FORMAT_ATTRIBUTES,
>         TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT): New.
>         * gcc/c-format.c: (replace_formatter_name_to_system_name): New
>         method to map target format attributes as system.
>         (decode_format_attr): Translate system format attribute names.
>         (format_types_orig): Prefix gnu attributes by "gnu_".
>         (ARGET_OVERRIDES_FORMAT_ATTRIBUTES): New extern for
>         target specific system format attribute override.
>         (gnu_target_overrides_format_attributes): Default overrides for
> gnu.
>         * gcc/c-format.h: (target_ovr_attr): New type for system attribute
>         mapping.
>         * gcc/config/i386/mingw32.h: (TARGET_OVERRIDES_FORMAT_ATTRIBUTES,
>         TARGET_OVERRIDES_FORMAT_ATTRIBUTES_COUNT,
>         TARGET_FORMAT_TYPES, TARGET_N_FORMAT_TYPES): New.
>         * gcc/config/i386/i386.c: Add ms-formatter definitions.
>         * gcc/testsuite/gcc.dg/sys_formatter.c: New test case.
>

Some quibles:

MS uses the "%I" flag as a length specifier for size_t/ptrdiff_t
http://msdn2.microsoft.com/en-us/library/tcxf1dw6(VS.80).aspx

Your patch still retains "I" in its gnu  extension sense.
MS printf will get confused by it.

TODO:
 MS printf does not handle "%hh" or "%ll" correctly and does not even
recognize long double.

Also what about  MS extension %hc' and '%lc'.

Danny



More information about the Gcc-patches mailing list