From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 6 03:40:01 2011 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 73BE41065670 for ; Sun, 6 Feb 2011 03:40:01 +0000 (UTC) (envelope-from freebsd-hackers@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id F2E4B8FC0A for ; Sun, 6 Feb 2011 03:40:00 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PlvTj-0002ci-76 for freebsd-hackers@freebsd.org; Sun, 06 Feb 2011 04:39:59 +0100 Received: from 189.61.208.111 ([189.61.208.111]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 06 Feb 2011 04:39:59 +0100 Received: from kubito by 189.61.208.111 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Sun, 06 Feb 2011 04:39:59 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-hackers@freebsd.org From: Raphael Kubo da Costa Date: Sun, 06 Feb 2011 01:39:43 -0200 Lines: 79 Message-ID: <87sjw1rfuo.fsf@gmail.com> References: <87vd0ys2no.fsf@gmail.com> <87fws2rqui.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 189.61.208.111 User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.2 (berkeley-unix) Cancel-Lock: sha1:wXgO0UxjDio+ejcu5b0NBL0xE0E= Subject: Re: Missing stdint.h includes? X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 06 Feb 2011 03:40:01 -0000 Garrett Cooper writes: > On Sat, Feb 5, 2011 at 3:42 PM, Raphael Kubo da Costa wrote: >> As for devinfo.h, shouldn't it just include stdint.h, sys/types.h or >> sys/param.h? > > sys/types.h should suffice, even though POSIX says it should be in > inttypes.h: http://pubs.opengroup.org/onlinepubs/009695399/basedefs/inttypes.h.html#tag_13_20 > > Kind of odd why they're redefined there (in sys/types.h) to be honest, > esp because POSIX doesn't say that they should be defined there. > Probably some pollution introduced that would widely break compiles > because sys/types.h is used everywhere, not inttypes.h. > >> What's the best way for me to help with this, PR-wise? > > I would honestly not go create more PR fodder. Just find a (doc?) > developer with a commit bit who's interested in cleaning up > incorrectness. I've inlined two patches below: * The first one should correct the documentation for rman(9). I'm sure there are problems with other headers, but I haven't checked yet. It adds sys/types.h to the man page -- I'm not sure if inttypes.h would be better (DragonFly just adds sys/param.h, FWIW). * The second one makes devinfo.h include sys/types.h instead of sys/_types.h -- I still think devinfo.h users should not need to explicitly include whateverdefinesuint32_t.h, as this, IMHO, is an implementation detail. It also adds the include to devinfo_var.h, which, although not installed, should be self-contained. Feedback very welcome. As a sidenote, what is the purpose of having both types.h and _types.h? Thanks! Patch 1: Index: stable/8/share/man/man9/rman.9 =================================================================== --- stable/8/share/man/man9/rman.9 (revision 218362) +++ stable/8/share/man/man9/rman.9 (working copy) @@ -55,6 +55,7 @@ .Nm rman_get_rid .Nd resource management functions .Sh SYNOPSIS +.In sys/types.h .In sys/rman.h .Ft int .Fn rman_activate_resource "struct resource *r" Patch 2: Index: stable/8/lib/libdevinfo/devinfo.h =================================================================== --- stable/8/lib/libdevinfo/devinfo.h (revision 218362) +++ stable/8/lib/libdevinfo/devinfo.h (working copy) @@ -31,7 +31,7 @@ #define _DEVINFO_H_INCLUDED #include -#include +#include typedef __uintptr_t devinfo_handle_t; #define DEVINFO_ROOT_DEVICE ((devinfo_handle_t)0) Index: stable/8/lib/libdevinfo/devinfo_var.h =================================================================== --- stable/8/lib/libdevinfo/devinfo_var.h (revision 218362) +++ stable/8/lib/libdevinfo/devinfo_var.h (working copy) @@ -27,6 +27,7 @@ * $FreeBSD$ */ +#include #include #include