Error in memset man page

Keith Thompson kst@mib.org
Mon Aug 24 17:58:00 GMT 2009


"man memset" shows the following synopsis for the memset function:

    #include <string.h>
    void *memset(const void *DST, int C, size_t LENGTH);

The "const" on the first parameter is incorrect.  The correct
prototype according to the C standard (both C90 and C99) is:

    void *memset(void *s, int c, size_t n);

(The differing parameter names are ok.)

The problem is only in the documentation; the actual declaration
doesn't have the const:

    % echo '#include <string.h>' | gcc -E - | grep memset
    void * __attribute__((__cdecl__)) memset (void *, int, size_t);

This was found by a poster on comp.lang.c calling himself
"Noob <root@127.0.0.1>".

-- 
Keith Thompson (The_Other_Keith) kst@mib.org  <http://www.ghoti.net/~kst>
Nokia
"We must do something.  This is something.  Therefore, we must do this."
    -- Antony Jay and Jonathan Lynn, "Yes Minister"

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple



More information about the Cygwin mailing list