Subject: lib/2751: [dM] fwopen() argument type mis-described
To: None <gnats-bugs@gnats.netbsd.org>
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
>Last-Modified:
>Originator:     der Mouse
>Organization:
	Dis-
>Release:        1.2_BETA
>Environment:
	Any (seen on Sun-3/260)
>Description:
	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.

>How-To-Repeat:
	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. :-)
>Fix:
	Add the missing "const" in the manpage.  Probably something
	like

*** /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)"
  .Sh DESCRIPTION
  The
  .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)"
  .Sh DESCRIPTION
  The
  .Fn funopen

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     01 EE 31 F6 BB 0C 34 36  00 F3 7C 5A C1 A0 67 1D
>Audit-Trail:
>Unformatted: