scandir() documented incorrectly

John Bruner jdb at mordor.UUCP
Fri Jun 28 08:49:09 AEST 1985


Index:	lib/libc/gen/scandir.c 4.2

Description:

The manual page (and source code) for scandir() declare the
second argument to be

	struct direct *(*namelist[]);

This is an array of pointers to pointers, which is incorrect.
However, in scandir() it compiles correctly because it is a formal
parameter and array parameters are considered to have pointer type.

This argument should be the address of a pointer to an array of
pointers to elements of type "struct direct":

	struct direct *(**namelist)[];

or, more simply:

	struct direct ***namelist;
-- 
  John Bruner (S-1 Project, Lawrence Livermore National Laboratory)
  MILNET: jdb at mordor [jdb at s1-c.ARPA]	(415) 422-0758
  UUCP: ...!ucbvax!dual!mordor!jdb 	...!seismo!mordor!jdb



More information about the Comp.bugs.4bsd.ucb-fixes mailing list