patch: mingw support for I32/I64 MS printf formatters to c-format.c

Joseph S. Myers joseph@codesourcery.com
Thu Apr 12 15:53:00 GMT 2007


On Thu, 12 Apr 2007, Kai Tietz wrote:

> Why do you think we should ignore rather than override those attributes by
> extending the dynamic_format_types mechanism ? AFAICS this is always a 
> target
> runtime issue, so that having a "system" and a none-"system" seems to be 
> just
> an unnecessary duplication. Isn't it ? If there is a need to have a 
> doublicated
> with different formatter rules, we could use also the TARGET_FORMAT_TYPES.

If a user is using a portable printf reimplementation to avoid problems 
with what may or may not be supported by different systems (e.g. 
snprintfv), they want the fixed GNU printf attribute.

If a user has a function which passes through to the system printf 
function, they want the system printf attribute.

Both are useful.  Both should be supported with different attributes.  The 
only question is whether the new one should be system_printf or 
gnu_printf.  If the new one is gnu_printf then you don't need special 
handling for duplicated attributes (because existing system headers will 
be using the "printf" attribute), if the new one is system_printf then you 
do need that special handling.

The new one being system_printf keeps the existing semantics of GNU C the 
same.  The new one being gnu_printf probably accords with the expectations 
of more system headers, but the workaround for duplicate attributes should 
largely avoid problems there.

-- 
Joseph S. Myers
joseph@codesourcery.com



More information about the Gcc-patches mailing list