This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: Gcc builtin review: strcpy, stpcpy, strcat, stpcat?
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Ondřej Bílka <neleai at seznam dot cz>
- Cc: <libc-alpha at sourceware dot org>, Andrew Pinski <pinskia at gmail dot com>
- Date: Thu, 28 May 2015 16:39:20 +0000
- Subject: Re: Gcc builtin review: strcpy, stpcpy, strcat, stpcat?
- Authentication-results: sourceware.org; auth=none
- References: <20150525101505 dot GA11233 at domone> <20150525114545 dot GC11233 at domone>
On Mon, 25 May 2015, Ondřej Bílka wrote:
> You should expoit that stpcpy returns end of string so gcc should
> replace
>
> strcpy (x,y)
> return strlen (x)
>
> with
>
> return stpcpy (x,y) - x
Subject to namespace issues (we could agree that __stpcpy is a stable ABI
- won't become a compat symbol - so that GCC can safely generate calls to
it).
--
Joseph S. Myers
joseph@codesourcery.com