Date: Fri, 21 Feb 1997 16:06:31 +1100 From: Bruce Evans <bde@zeta.org.au> To: freebsd-current@freebsd.org, jmg@nike.efn.org Subject: Re: bzero and FD_ZERO Message-ID: <199702210506.QAA28404@godzilla.zeta.org.au>
next in thread | raw e-mail | index | archive | help
>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(). <string.h> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199702210506.QAA28404>