NetBSD Problem Report #3368

Received: (qmail-queue invoked from smtpd); 20 Mar 1997 22:45:41 -0000
Message-Id: <199703200712.QAA00865@pavlov.enami.ba2.so-net.or.jp>
Date: Thu, 20 Mar 1997 16:12:49 +0900 (JST)
From: enami@ba2.so-net.or.jp
Reply-To: enami@ba2.so-net.or.jp
To: gnats-bugs@gnats.netbsd.org
Subject: another typo in fts(3); fts_open takes a pointer to function
	which returns int.
X-Send-Pr-Version: 3.95

>Number:         3368
>Category:       lib
>Synopsis:       another typo in fts(3); fts_open takes a pointer to function which returns int.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          closed
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Mar 20 14:50:00 +0000 1997
>Closed-Date:    Thu Mar 20 21:31:46 +0000 1997
>Last-Modified:  Fri Mar 21 05:31:53 +0000 1997
>Originator:     enami tsugutomo
>Release:        NetBSD-current 1997 Mar. 18
>Organization:
	an individual
>Environment:
System: NetBSD pavlov.enami.ba2.so-net.or.jp 1.2D NetBSD 1.2D (PAVLOV) #200: Thu Mar 20 11:01:57 JST 1997 enami@pavlov.enami.ba2.so-net.or.jp:/b/netbsd/kernel/compile/PAVLOV i386


>Description:
	There is another typo in fts(3); fts_open takes a pointer to
	function which returns not pointer to int but just int.

	In fts(3), there is a description like this:

     FTS *
     fts_open(char * const *path_argv, int options,
             int *compar(const FTSENT **, const FTSENT **))

	Because function call operator () has high priority than dereference
	operator *, it means that `compar' is a function which returns
	pointer to int (and the value fts_open is passed is a pointer to it).

	But in /usr/include/fts.h, fts_open is prototyped like this:

FTS	*fts_open __P((char * const *, int,
	    int (*)(const FTSENT **, const FTSENT **)));

	It says that third argument is a pointer to function which returns int.

>How-To-Repeat:
	Type man fts and read it.  Then, read /usr/include/fts.h or
	/usr/src/lib/libc/gen/fts.c.
>Fix:
	Give parentheses around `*compar'.

Index: fts.3
===================================================================
RCS file: /a/cvsroot/NetBSD/src/lib/libc/gen/fts.3,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 fts.3
--- fts.3	1996/11/16 10:04:49	1.1.1.1
+++ fts.3	1997/03/20 06:58:47
@@ -44,7 +44,7 @@
 .Fd #include <sys/stat.h>
 .Fd #include <fts.h>
 .Ft FTS *
-.Fn fts_open "char * const *path_argv" "int options" "int *compar(const FTSENT **, const FTSENT **)"
+.Fn fts_open "char * const *path_argv" "int options" "int (*compar)(const FTSENT **, const FTSENT **)"
 .Ft FTSENT *
 .Fn fts_read "FTS *ftsp"
 .Ft FTSENT *
>Release-Note:
>Audit-Trail:

State-Changed-From-To: open->closed
State-Changed-By: mikel
State-Changed-When: Thu Mar 20 21:31:46 1997
State-Changed-Why:
fixed as suggested, thanks.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.