This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH] Optimize sprintf(buffer,"foo")
- From: "Kaveh R. Ghazi" <ghazi at caip dot rutgers dot edu>
- To: roger at eyesopen dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Sun, 22 Jun 2003 22:31:27 -0400 (EDT)
- Subject: Re: [PATCH] Optimize sprintf(buffer,"foo")
- References: <Pine.LNX.firstname.lastname@example.org>
> The performance of strcpy+strlen is better than that the equivalent
> sprintf on most platforms
It's also bigger, so the -Os folks will come knocking eventually. :-)
You probably want to check optimize_size and punt if the strlen isn't
turned into a constant.
Kaveh R. Ghazi email@example.com