Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Jul 1997 10:11:43 +0200 (MET DST)
From:      Wolfgang Helbig <helbig@MX.BA-Stuttgart.De>
To:        r.carey@dcs.napier.ac.uk (Robin Carey)
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: Hello boys its me again.
Message-ID:  <199707260811.KAA10500@helbig.informatik.ba-stuttgart.de>
In-Reply-To: <Pine.SOL.3.91.970725161441.2931A-100000@artemis> from Robin Carey at "Jul 25, 97 04:20:21 pm"

next in thread | previous in thread | raw e-mail | index | archive | help
Robin Carey writes:

> Sorry for not send-pr'ing this ... I noticed this the other day:
> 
> Basically you've got bzero(3) and bcopy(3) being used in
> /usr/include/sys/types.h for the FD_ZERO() and FD_SET() macros, and you've
> not included <stdlib.h> - or is it <string.h> - never can tell with these
> dodgy non-ANSI calls :) This results in a warning with gcc -Wall if you

The FD_???? macros support the select(2) call.  Both the bzero(3)
and select(2) calls belong to the same compatibility class:  Neither
ANSI nor POSIX but BSD (and supported by other Unices that emulate
(part of) BSD). There is no harm if one depends on the other and
its desirable to provoke a warning if compiled with -ansi and -Wall.
This warning would not be given if memset(3) is used instead.

> don't accidentally include the right header before <sys/types.h> .... I'd
> suggest changing them to memset(3) and memcpy(3) respectively, which are 
> ANSI and need <string.h>. BTW Are those FD_*() macros meant to be in 
> <sys/types.h> ? I'd have thought <unistd.h> would be a better place, but 
> thats just my warped sense of direction :)

Your suggested change is gratituos and would break BSD compatibility.

Instead we should add the ``#include <string.h>'' clause to all
man pages that have the ``#include <sys_types.h>'' line or make
sys/types.h self sufficient to satisfy -Wall.

Wolfgang

PS
cc changed from -bugs to -hackers.

> 
> L8r.
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707260811.KAA10500>