Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/5/84; site mordor.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!think!harvard!seismo!ut-sally!mordor!jdb From: jdb@mordor.UUCP (John Bruner) Newsgroups: net.bugs.4bsd Subject: scandir() documented incorrectly Message-ID: <2436@mordor.UUCP> Date: Thu, 27-Jun-85 18:49:09 EDT Article-I.D.: mordor.2436 Posted: Thu Jun 27 18:49:09 1985 Date-Received: Sat, 29-Jun-85 01:22:55 EDT Distribution: net Organization: S-1 Project, LLNL Lines: 25 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@mordor [jdb@s1-c.ARPA] (415) 422-0758 UUCP: ...!ucbvax!dual!mordor!jdb ...!seismo!mordor!jdb