This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Patch to add __builtin_printf("string\n") -> puts("string")
- To: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- Subject: Re: Patch to add __builtin_printf("string\n") -> puts("string")
- From: Raja R Harinath <harinath at cs dot umn dot edu>
- Date: 21 Sep 2000 16:34:51 -0500
- Cc: gcc-patches at gcc dot gnu dot org
- References: <200009211820.OAA01264@caip.rutgers.edu><d9snqtwib8.fsf@han.cs.umn.edu>
Raja R Harinath <harinath@cs.umn.edu> writes:
> "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> writes:
> > printf("string\n") -> puts("string")
>
> Isn't this a size pessimization: you may need to store two copies of
> the constant string -- one with the trailing '\n' and one without.
> Especially in the case
>
> const char *p = "foo\n";
> void bar () { printf(p); }
I mean
const char *const p = "foo\n";
- Hari
--
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions." -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing." -- Roy L Ash