From owner-freebsd-hackers@FreeBSD.ORG Thu Feb 10 04:56:23 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 968761065670 for ; Thu, 10 Feb 2011 04:56:23 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 4617A8FC14 for ; Thu, 10 Feb 2011 04:56:23 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id p1A4spVt096725 for ; Wed, 9 Feb 2011 21:54:52 -0700 (MST) (envelope-from imp@bsdimp.com) Message-ID: <4D536F9B.6070809@bsdimp.com> Date: Wed, 09 Feb 2011 21:54:51 -0700 From: Warner Losh User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.2.13) Gecko/20101211 Thunderbird/3.1.7 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <87vd0ys2no.fsf@gmail.com> <87fws2rqui.fsf@gmail.com> <87sjw1rfuo.fsf@gmail.com> In-Reply-To: <87sjw1rfuo.fsf@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Thu, 10 Feb 2011 04:56:23 -0000 On 02/05/2011 20:39, Raphael Kubo da Costa wrote: > 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 > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org" > > > committed. Warner