This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/82429] strcpy to stpcpy transformation disabled in strict mode
- From: "joseph at codesourcery dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 04 Oct 2017 16:36:37 +0000
- Subject: [Bug tree-optimization/82429] strcpy to stpcpy transformation disabled in strict mode
- Auto-submitted: auto-generated
- References: <bug-82429-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82429
--- Comment #2 from joseph at codesourcery dot com <joseph at codesourcery dot com> ---
Strictly, that a program declares stpcpy should be irrelevant if the
declaration is outside system headers, because it could declare and define
it for some other purpose (even if the prototype matches).
If declared *in system headers*, stpcpy can be assumed to have POSIX
semantics; likewise if __builtin_stpcpy is called by the program (because
calling __builtin_stpcpy implies it's OK to generate a call to stpcpy for
such a call, so stpcpy can be assumed to have POSIX semantics).