From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Schmid To: bkoz@gcc.gnu.org Cc: gcc-prs@gcc.gnu.org Subject: Re: libstdc++/2767 Date: Tue, 08 May 2001 17:16:00 -0000 Message-id: <20010509001601.25214.qmail@sourceware.cygnus.com> X-SW-Source: 2001-05/msg00246.html List-Id: The following reply was made to PR libstdc++/2767; it has been noted by GNATS. From: Peter Schmid To: bkoz@gcc.gnu.org Cc: gcc-gnats@gcc.gnu.org, nobody@gcc.gnu.org, stephen@bregmasoft.com Subject: Re: libstdc++/2767 Date: Wed, 9 May 2001 03:09:22 +0200 (CEST) |Regardless, the current implementation is incorrect, as this declaration doesn't exist: | extern "C" const char* strchr(const char*, int); | should be | extern "C" char* strchr(const char*, int); I am puzzled. Stroustrup says in his book "The C++ programming language" (special edition) on page 599: "Functions for manipulating C-style strings are found in and : ... const char* strchr(const char*, int); char* strchr(char*, int);" On the following page he mentions the "C standard library definition, not C++" of strchr: char* strchr(cont char*, int); This is the same as stated in the book "C, a refrence manual by Harbison and Steele. Therefore, I believe, the prototypes in the current libstdc++ implementation for strchr are indeed correct. One has to cope with the different signatures for the C and the C++ versions of the function strchr (among others). Hope this is correct, Peter Schmid