patch to suggest putc/fputs over printf("string") or printf("\n")

Joe Buck jbuck@Synopsys.COM
Sun Jan 10 13:57:00 GMT 1999


>   > But there are also situations where the replacement returned by a
>   > gettext call with an argument without format specifiers contains
>   > format specifiers.  A call could look like this:
>   > 
>   > 	printf (gettext ("no format here"), some_variable)
>   > 
>   > The return value of the gettext call could be "value %d".
> And in that case we can not and must not optimize.

I think that this is bad practice.  The gettext argument should have a
%d and all translations should have a %d.  Otherwise we can't detect
format errors with gettext.

> So, you're going to give up an optimization that applies to a large number
> of programs because it does not apply to gettext.  That is absurd.  

The optimization would apply to gettext if gettext were used according
to reasonable rules.



More information about the Gcc-patches mailing list