From owner-freebsd-current Thu Feb 20 21:12:52 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id VAA02735 for current-outgoing; Thu, 20 Feb 1997 21:12:52 -0800 (PST) Received: from godzilla.zeta.org.au (godzilla.zeta.org.au [203.2.228.19]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id VAA02730 for ; Thu, 20 Feb 1997 21:12:50 -0800 (PST) Received: (from bde@localhost) by godzilla.zeta.org.au (8.8.3/8.6.9) id QAA28404; Fri, 21 Feb 1997 16:06:31 +1100 Date: Fri, 21 Feb 1997 16:06:31 +1100 From: Bruce Evans Message-Id: <199702210506.QAA28404@godzilla.zeta.org.au> To: freebsd-current@freebsd.org, jmg@nike.efn.org Subject: Re: bzero and FD_ZERO Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >today I was writing a program that uses FD_ZERO... but I wasn't using >string.h... if you compile it with -Wall you will get a warning about >implicet declaration of bzero... > >should this happen? and what is the proper fix for it? (do we really >require including string.h? should I document that as a header that is >required? ) The library should use a private or reserved function, e.g., __bzero() or memset(). shouldn't be included or a prerequisite. NetBSD uses memset() except in the kernel. The Gnu library uses __FD_ZERO(), which on the i386 expands to i586-pessimized inline asm code involving stosl. There are many more bugs like this if you compile with all warning enabled: -Wall -ansi -pedantic \ -Wbad-function-cast \ -Wcast-align \ -Wcast-qual \ -Wchar-subscripts \ -Wconversion \ -Winline \ -Wmissing-prototypes \ -Wnested-externs \ -Wpointer-arith \ -Wredundant-decls \ -Wshadow \ -Wstrict-prototypes \ -Wtraditional \ -Wwrite-strings Bruce