Mail Archives: cygwin/2005/07/26/08:52:24
James McLaughlin wrote:
> 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?
>
> 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?
The C specification ISO/IEC 9899:1999 (2nd Edition) is,
I believe, the definitive documentation for the <string.h>
functions - these are part of the C standard library which
any conforming implementation must provide.
[You can download a pdf of this standard from www.iso.ch for
a small fee.]
Looking at sources such as newlib or glibc will only show
you how it is implemented, not why the specification was chosen
to be that way.
Note also that gcc "knows" about a number of C library functions,
including the string ones, and (depending on the target platform
and the selected level of optimisation) may generate inline code
rather than call the library routine.
-- Cliff
--
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 -