delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/07/26/08:52:24

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Message-ID: <42E63132.6080406@hones.org.uk>
Date: Tue, 26 Jul 2005 13:48:50 +0100
From: Cliff Hones <cliff AT hones DOT org DOT uk>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: gcc-core and g++ source
References: <20050726114441 DOT 60159 DOT qmail AT web31702 DOT mail DOT mud DOT yahoo DOT com>
In-Reply-To: <20050726114441.60159.qmail@web31702.mail.mud.yahoo.com>
X-Spam-Score: -2.3 (--)
X-IsSubscribed: yes

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 -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019