Mail Archives: cygwin/2005/07/26/08:23:34
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to James McLaughlin on 7/26/2005 5:44 AM:
> I've been wondering about why functions such as strcpy
> return char*, instead of being void, so I thought I'd
> look at the source for this function and see if there
> were any informative comments. However, while I've got
> the g++ and gcc-core source, I can't find the source
> for the standard <string.h> functions - can anyone
> tell me which file to look in?
gcc does not provide it; look at newlib/libc/string/strcpy.c instead (I
look at newlib CVS, so I'm not sure which package in setup.exe provides
the newlib source snapshot used for the current build). And as to why it
returns char* and not void, it is because the C language and POSIX require
it to do so. And as a result, you can do things like:
strcat (strcpy (dest, source), ".exe");
>
> In fact, is there any sort of document detailing where
> to find the source for the functions defined in , say,
> header <?.h>? (organised by header)? If not, are there
> any plans to include such a document in the Cygwin
> docs?
Only if someone (how about you?) volunteers to write them.
- --
Life is short - so eat dessert first!
Eric Blake ebb9 AT byu DOT net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFC5is284KuGfSFAYARAnApAKCkfevcoHEJR2/E5hqneXWcdDNr6ACbBrf0
HWoBg6W24ljgyOn/azVRmj0=
=18kh
-----END PGP SIGNATURE-----
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
- Raw text -