This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Patch to add __builtin_printf("string\n") -> puts("string")


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]