Subject: misc/30166: Missing include in select(2) manual page
To: None <misc-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <khorben@defora.org>
List: netbsd-bugs
Date: 05/07/2005 19:51:00
>Number:         30166
>Category:       misc
>Synopsis:       Missing include in select(2) manual page
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    misc-bug-people
>State:          open
>Class:          doc-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 07 19:51:00 +0000 2005
>Originator:     Pierre Pronchery
>Release:        2.0.0 SPARC
>Organization:
>Environment:
NetBSD ss20 2.0 NetBSD 2.0 (GENERIC) #0: Thu Dec  2 01:57:30 UTC 2004  builds@build:/big/builds/ab/netbsd-2-0-RELEASE/sparc/200411300000Z-obj/big/builds/ab/netbsd-2-0-RELEASE/src/sys/arch/sparc/compile/GENERIC sparc
>Description:
I am compiling a program of my own, which has this line:
FD_ZERO(&state->rfds);

causing the compiler to complain like this:
khorben@ss20$ make CFLAGS="-g"
cc -W -Wall -ansi -g -c inetd.c
inetd.c: In function `_inetd_setup':
inetd.c:182: warning: implicit declaration of function `memset'

while the select(2) manual page doesn't mention to include <string.h>.
>How-To-Repeat:
Simply write a dumb C file using FD_ZERO() and not including <string.h>, since it is expanded to:
(void)memset((&state->rfds), 0, sizeof(*(&state->rfds)));

and compile it with "-Wall" gcc flag set.
>Fix: