Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 10 Jun 2002 21:18:41 -0400
From:      Mike Barcroft <mike@FreeBSD.ORG>
To:        Matthew Dillon <dillon@apollo.backplane.com>
Cc:        Sergey Babkin <babkin@bellatlantic.net>, "Greg 'groggy' Lehey" <grog@FreeBSD.ORG>, cvs-committers@FreeBSD.ORG, cvs-all@FreeBSD.ORG
Subject:   Re: cvs commit: src/include pwd.h
Message-ID:  <20020610211841.C90728@espresso.q9media.com>
In-Reply-To: <200206102347.g5ANlA6I023876@apollo.backplane.com>; from dillon@apollo.backplane.com on Mon, Jun 10, 2002 at 04:47:10PM -0700
References:  <200206091939.g59JdJC05285@freefall.freebsd.org> <20020610004026.GD61036@wantadilla.lemis.com> <200206100049.g5A0nr1P004846@apollo.backplane.com> <20020609211243.C51371@espresso.q9media.com> <200206100314.g5A3EjTt005317@apollo.backplane.com> <20020609232020.F51371@espresso.q9media.com> <3D05364A.469A44A5@bellatlantic.net> <200206102347.g5ANlA6I023876@apollo.backplane.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Matthew Dillon <dillon@apollo.backplane.com> writes:
>     My worry here is that so *many* includes depend on things in sys/types.h,
>     if we were to carry out this 'duplicate typedef' idea to its fullest
>     extent we would have hundreds of dups over many of the header files
>     in the system.  And even with that many programs would either still
>     wind up having to include <sys/types.h>, or certain include files
>     would still have to include <sys/types.h> due to heavy type 
>     dependancies.
> 
>     So even with this methodology I see no way to be able to guarentee to
>     a programmer that pollution from the contents of <sys/types.h> can be
>     avoided, even if the programmer does everything right.

Try using any of the interfaces in the headers I've brought up to
conformance to verify that <sys/types.h> is no longer needed.
<arpa/inet.h>, <strings.h>, <string.h>, <sys/un.h>, <netinet/in.h>,
<sys/wait.h>, <inttypes.h>, <stdint.h>, <sys/wait.h>.

Some of these might require a POSIX environment
(#define _POSIX_C_SOURCE 200112L), but for the most part even BSD
namespace works without a <sys/types.h>.

>     This issue of pollution may be true, but if most programs wind up 
>     including <sys/types.h> anyway it is something we just have to live 
>     with.  The C language is not hierarchical, it's a fact of life.

None of the headers defined by the Standard will require <sys/types.h>
AFAIK.  We might wish to take this approach with BSD headers too,
since it seems to work quite well.

>     I do not think it will have a positive effect on the codebase and 
>     it *will* seriously mangle the include files if the concept is taken
>     to extremes.  If you take it to extremes you *might* be able to 
>     reduce pollution from <sys/types.h>, but not eliminate it.  If you do
>     not take it to extremes there isn't much of a point to doing it in
>     the first place since there will be no deterministic way for the
>     programmer to have any assurance of reduced pollution.  We wind up being
>     screwed either way.

I don't follow.

Best regards,
Mike Barcroft

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




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