diff mbox

stpcpy comes from Turbo C [BZ #3629]

Message ID 20160510075014.A743C41C38CF4@oldenburg.str.redhat.com
State New
Headers show

Commit Message

Florian Weimer May 10, 2016, 7:50 a.m. UTC
The earlierst reference I could find is in a German book on Borland's
Turbo C programming environment (Ekkehard Kaier, Edwin Rudolfs,
»Turbo C Grundkurs«, first published in 1988).  It is not generally
available on current Microsoft platforms, and there are online
references that claim that it was not part of earlier Microsoft C
environments.  This suggests that the previous speculative attribution
to MS-DOS (sic) was incorrect.

2016-05-10  Florian Weimer  <fweimer@redhat.com>

	[BZ #3629]
	* manual/string.texi (Copying Strings and Arrays): Document
	provenience of the stpcpy function.

Comments

Gabriel F. T. Gomes May 10, 2016, 12:01 p.m. UTC | #1
On Tue, 10 May 2016 09:50:14 +0200
fweimer@redhat.com (Florian Weimer) wrote:

> The earlierst reference I could find is in a German book on Borland's
> Turbo C programming environment (Ekkehard Kaier, Edwin Rudolfs,
> »Turbo C Grundkurs«, first published in 1988).  It is not generally
> available on current Microsoft platforms, and there are online
> references that claim that it was not part of earlier Microsoft C
> environments.  This suggests that the previous speculative attribution
> to MS-DOS (sic) was incorrect.
> 
> 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..f22d2ac 100644
> --- a/manual/string.texi
> +++ b/manual/string.texi
> @@ -612,9 +612,8 @@ 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 a Turbo C extension.  It is not part of the ISO or
> +POSIX standards.

According to the manpage for stpcpy, it has been added to POSIX.1-2008.

It shows up in section 13 (Headers) under 'string.h':
http://pubs.opengroup.org/onlinepubs/9699919799/nframe.html

Perhaps a small change your last sentence?

Other than that, lgtm.

> 
>  Its behavior is undefined if the strings overlap.  The function is
>  declared in @file{string.h}.
>
DJ Delorie May 10, 2016, 4:08 p.m. UTC | #2
I can confirm it's documented in my Turbo C manual from 1987.  There's
no specific information on where they got it from, other than saying
str*() functions _as a group_ are "available on Unix systems."
(and that K&R define strcat() ;)

> This suggests that the previous speculative attribution to MS-DOS
> (sic) was incorrect.

Of course, Turbo C is an MS-DOS compiler :-)

(for a while it was the dominant MS-DOS compiler)
Ulrich Drepper May 10, 2016, 4:37 p.m. UTC | #3
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

Page F-178.
diff mbox

Patch

diff --git a/manual/string.texi b/manual/string.texi
index 016fd0b..f22d2ac 100644
--- a/manual/string.texi
+++ b/manual/string.texi
@@ -612,9 +612,8 @@  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 a Turbo C extension.  It is not part of the ISO or
+POSIX standards.
 
 Its behavior is undefined if the strings overlap.  The function is
 declared in @file{string.h}.