This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to add __builtin_printf
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch to add __builtin_printf
- From: Todd Vierling <tv at pobox dot com>
- Date: Tue, 19 Sep 2000 16:47:07 -0400 (EDT)
- cc: zack at rabi dot columbia dot edu, gcc-patches at gcc dot gnu dot org
On Tue, 19 Sep 2000, Kaveh R. Ghazi wrote:
: > char *foo; printf (foo); -> printf ("%s", foo); [->fputs (foo, stdout)]
: I'm about to submit patches to achieve: printf("%s",foo)->fputs(foo,stdout)
: (Capturing stdout was the hairy part.)
I presume it's hairy because "stdout" is a CPP macro on many operating
systems? 8^)
: Anyway, whether to automatically do the transformation you suggest on
: printf(foo) is debatable IMHO given that the original is a legal (but
: admittedly dangerous) use, and the transformation by nature isn't
: equivalent. (E.g. "%%" gets printf-processed in the original style.)
I believe a warning, not a transform, is appropriate in that case. ("Leave
the transform to the programmer" if it's not exactly equivalent on output.)
--
-- Todd Vierling (tv@pobox.com)