From owner-freebsd-arch Fri Sep 7 12:11:12 2001 Delivered-To: freebsd-arch@freebsd.org Received: from falcon.mail.pas.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id 4365637B403 for ; Fri, 7 Sep 2001 12:11:10 -0700 (PDT) Received: from mindspring.com (dialup-209.247.142.57.Dial1.SanJose1.Level3.net [209.247.142.57]) by falcon.mail.pas.earthlink.net (8.11.5/8.9.3) with ESMTP id f87JB8325985; Fri, 7 Sep 2001 12:11:08 -0700 (PDT) Message-ID: <3B991BF8.5BF2E5E2@mindspring.com> Date: Fri, 07 Sep 2001 12:11:52 -0700 From: Terry Lambert Reply-To: tlambert2@mindspring.com X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Bill Fenner Cc: arch@freebsd.org Subject: Re: Causing to depend on References: <200109071748.KAA21991@windsor.research.att.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Bill Fenner wrote: > > Er, I think I take back my own objection. IEEE Std 1003.1-200x says > > SYNOPSIS > #include > ... > Inclusion of the header may also make > visible all symbols from and . ... and it MAY not. You should just include both yourself, and be done with it. By forcing inclusion of socket.h, you break the layering abstraction. If this is done with pointers, rather than instances or member references, in the API code, just forward declare the structure, and use it as an opaque type, e.g.: struct socket; struct foo { struct socket *mysock; ... }; As long as it's a pointer, the compiler will not balk at it being an incomplete type, unless you attempt to dereference it. Since that should only ever happen in code, and code does not belong in header files, problem solved. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message