Subject: Error in memset man page
From: Keith Thompson <[email-masked]>
To: [email-masked]
Cc: Keith Thompson <[email-masked]>
Date: Mon, 24 Aug 2009 10:57:23 -0700
List-Id: <cygwin.cygwin.com>

"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 <[email-masked]>".

-- 
Keith Thompson (The_Other_Keith) [email-masked]  <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