This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] stpcpy comes from Turbo C [BZ #3629]
- From: Florian Weimer <fweimer at redhat dot com>
- To: Ulrich Drepper <drepper at gmail dot com>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 11 May 2016 20:41:27 +0200
- Subject: Re: [PATCH] stpcpy comes from Turbo C [BZ #3629]
- Authentication-results: sourceware.org; auth=none
- References: <20160510075014 dot A743C41C38CF4 at oldenburg dot str dot redhat dot com> <CAOPLpQfeXVs4zyM-oL+7P-gtUS0XNowdJLTtu4XWdk0pT+_qmw at mail dot gmail dot com>
On 05/10/2016 06:37 PM, Ulrich Drepper wrote:
On Tue, May 10, 2016 at 3:50 AM, Florian Weimer <fweimer@redhat.com> wrote:
+This function is a Turbo C extension. It is not part of the ISO or
+POSIX standards.
Even the current man pages tell you that this isn't right. Of course
it was an extension but not introduced in Turbo C. It was introduced
earlier. Amiga Lattice C had it:
http://www.bombjack.org/commodore/amiga/applications/Lattice_C_Compiler_V3_Programmers_Reference_Guide_%28Sep_12_1986%29.pdf
I find it difficult to believe that Turbo C copied from there, I find it
far more likely that there was a common ancestor.
What about this patch, then?
Thanks,
Florian
2016-05-10 Florian Weimer <fweimer@redhat.com>
[BZ #3629]
* manual/string.texi (Copying Strings and Arrays): Document
provenience of the stpcpy function.
diff --git a/manual/string.texi b/manual/string.texi
index 016fd0b..d78381e 100644
--- a/manual/string.texi
+++ b/manual/string.texi
@@ -612,9 +612,7 @@ and @samp{bar} to produce @samp{foobar}, which it then prints.
@include stpcpy.c.texi
@end smallexample
-This function is not part of the ISO or POSIX standards, and is not
-customary on Unix systems, but we did not invent it either. Perhaps it
-comes from MS-DOG.
+This function is part of POSIX.1-2008 and later editions.
Its behavior is undefined if the strings overlap. The function is
declared in @file{string.h}.