From owner-freebsd-arch Fri Sep 28 7: 7:19 2001 Delivered-To: freebsd-arch@freebsd.org Received: from rover.village.org (rover.bsdimp.com [204.144.255.66]) by hub.freebsd.org (Postfix) with ESMTP id 107D737B410 for ; Fri, 28 Sep 2001 07:07:15 -0700 (PDT) Received: from harmony.village.org (harmony.village.org [10.0.0.6]) by rover.village.org (8.11.3/8.11.3) with ESMTP id f8SE7Du53616; Fri, 28 Sep 2001 08:07:13 -0600 (MDT) (envelope-from imp@harmony.village.org) Received: from harmony.village.org (localhost [127.0.0.1]) by harmony.village.org (8.11.6/8.11.6) with ESMTP id f8SE7C781171; Fri, 28 Sep 2001 08:07:12 -0600 (MDT) (envelope-from imp@harmony.village.org) Message-Id: <200109281407.f8SE7C781171@harmony.village.org> To: Bruce Evans Subject: Re: Proposed change: d_thread_t for driver portability between 4.x and 5.x Cc: arch@FreeBSD.org In-reply-to: Your message of "Fri, 28 Sep 2001 19:39:33 +1000." <20010928192532.M52718-100000@delplex.bde.org> References: <20010928192532.M52718-100000@delplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <81163.1001686029.1@harmony.village.org> Date: Fri, 28 Sep 2001 08:07:12 -0600 From: Warner Losh 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 In message <20010928192532.M52718-100000@delplex.bde.org> Bruce Evans writes: : This breaks 2 style rules :-). From style(9): : : Avoid using typedefs for structure types. Such typedefs make it impossi- : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ : ble for applications to use pointers to such a structure opaquely, which : is both possible and beneficial when using an ordinary struct tag. When : convention requires a typedef, make its name match the struct tag. Avoid : ^^^^^ : typedefs ending in ``_t'', except as specified in Standard C or by POSIX. : ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ : : These are wollman's rules, not KNF. I strongly agree with them, but we have : too many of these personal rules which not everyone agreed to. I know. But you can't typedef a struct to be another struct. And it is no more broken than then d_open_t and this file isn't used by userland progarms. : I can see the use of d_thread_t^Hs if it is truly opaque. Declaring it : only in or even including breaks its opaqueness. : Unfortunately, the other rule-breaking declarations like d_open_t require : including the full in device drivers. It's another bug : that dev_t is not either truly opaque or declared as "struct foo *". Right. This is a portability aid that we need because it is clear that doing drivers for -current and -stable is going to be a big pita and people will invent their own, possibly wrong, ways of doing this. Warner To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message