Subject: lib/2751: [dM] fwopen() argument type mis-described
To: None <>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: netbsd-bugs
Date: 09/13/1996 07:41:53
>Number:         2751
>Category:       lib
>Synopsis:       [dM] fwopen() argument type mis-described
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people (Library Bug People)
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Sep 13 04:50:00 1996
>Originator:     der Mouse
>Release:        1.2_BETA
	Any (seen on Sun-3/260)
	The manpage description of fwopen()'s second argument (in the
	funopen(3) manpage) reads

     FILE *
     fwopen(void *cookie, int (*writefn)(void *, char *, int))

	However, the second argument to writefn() is actually a const
	char *, as implied by the description of funopen() and the text
	comment that fropen and fwopen are just #defines.

	Pass an int (*)(void *, char *, int) to fwopen and watch the
	complaints about "incompatible pointer type".  Read the manpage
	and wonder why.  Read the manpage more carefully and realize
	why. :-)
	Add the missing "const" in the manpage.  Probably something

*** /usr/src/lib/libc/stdio/funopen.3   Sun Feb  4 11:33:30 1996
--- /tmp/funopen.3      Fri Sep 13 07:40:57 1996
*** 50,56 ****
  .Ft FILE *
  .Fn fropen "void  *cookie" "int  (*readfn)(void *, char *, int)"
  .Ft FILE *
! .Fn fwopen "void  *cookie" "int  (*writefn)(void *, char *, int)"
  .Fn funopen
--- 50,56 ----
  .Ft FILE *
  .Fn fropen "void  *cookie" "int  (*readfn)(void *, char *, int)"
  .Ft FILE *
! .Fn fwopen "void  *cookie" "int  (*writefn)(void *, const char *, int)"
  .Fn funopen

					der Mouse

		     01 EE 31 F6 BB 0C 34 36  00 F3 7C 5A C1 A0 67 1D