help needed with gcc-4.4 build failure

Michel Salim michel.sylvan at gmail.com
Wed Feb 18 13:49:49 UTC 2009


On Wed, Feb 18, 2009 at 8:39 AM, Julian Sikorski <belegdol at gmail.com> wrote:
> man strchr says:
> char *strchr(const char *s, int c);
>
> I don't see what is wrong since the argument is a const char* string.
>
> I can't reproduce the issue. May be the signature of strchr changed in
> glibc?
> Anyway, the above signature is not consistent since it returns a char* which
> is a substring of a const char*.
> If this is the case, there is a need for a test in configure to find which
> signature version is available.
>
The manpages are out of date -- see Ulrich Drepper's post:
http://markmail.org/message/e5y6atneqztuvpw6#query:+page:1+mid:hdkehz7bgl5b6vgc+state:results

Called from C++, you have to do the following:
- include <cstring> rather than <string.h>
- if you pass in a const char *, the output should be stored in a
const char * variable
- otherwise, the output should be assigned to a char * variable

HTH,

-- 
miʃel salim  •  http://hircus.jaiku.com/
IUCS         •  msalim at cs.indiana.edu
Fedora       •  salimma at fedoraproject.org
MacPorts     •  hircus at macports.org




More information about the fedora-devel-list mailing list