On 11/30/2009 12:42 AM, Ralf Wildenhues wrote:

I don't see a warning to that end, my system declares strrchr as
        #include<string.h>

        char *strrchr(const char *s, int c);

What does yours (darwin?) do instead?

Actually, this was on Fedora 11, gcc-4.4.1, glibc-2.10, which for c++, declares strrchr and strchr as having the same return type as the first argument, char* for a char* argument, and const char* for a const char* argument:

extern "C++"
{
extern char *strrchr (char *__s, int __c)
throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern __const char *strrchr (__const char *__s, int __c)
throw () __asm ("strrchr") __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));

http://udrepper.livejournal.com/20948.html

Peter
--
Peter O'Gorman
http://pogma.com


Reply via email to