From owner-freebsd-hackers@FreeBSD.ORG Sun Feb 6 00:52:12 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 5744B106564A for ; Sun, 6 Feb 2011 00:52:12 +0000 (UTC) (envelope-from yanegomi@gmail.com) Received: from mail-wy0-f182.google.com (mail-wy0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id DC6F68FC0C for ; Sun, 6 Feb 2011 00:52:11 +0000 (UTC) Received: by wyf19 with SMTP id 19so3591720wyf.13 for ; Sat, 05 Feb 2011 16:52:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=o488qfcQ4ezAuu2+POnUDzQ2qZTGubw0/fhdywumTcc=; b=rs2Jx4Lqw00ZSjr+qHGTAyoK5XCBNP6HCcRI9jp78F2uY1LNnEQBwjsV3vOtNo8eS4 x8TpYRY6rcB0ysAywgYjo5SfFdghHT64+ji9vSMILDN1bWDFCWXWj7hkHfwthenWHJdV eO0OeGit2BA667OVlvMiFqBf6yLeYid+dzPq8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=dH6t7K1/Es+5i/cOLnzw1GMvkYE0pB8M7a3wMx63sHEdgA6EE3I9zo1TnEyHjvQU4C 1fncb82mQrMx1hzGOCXCo+ane2kSjmF374WDTtES96cKwO403vAbLDCYfB7lcLnY9wgP N6LnzaVN3pDKPHXSNhR/PiToiFkJAxcMKQ5n4= MIME-Version: 1.0 Received: by 10.216.165.85 with SMTP id d63mr12905525wel.12.1296953529662; Sat, 05 Feb 2011 16:52:09 -0800 (PST) Sender: yanegomi@gmail.com Received: by 10.216.71.200 with HTTP; Sat, 5 Feb 2011 16:52:09 -0800 (PST) In-Reply-To: <87fws2rqui.fsf@gmail.com> References: <87vd0ys2no.fsf@gmail.com> <87fws2rqui.fsf@gmail.com> Date: Sat, 5 Feb 2011 16:52:09 -0800 X-Google-Sender-Auth: w_5800DCnfZMwDZst-RJupWtt8c Message-ID: From: Garrett Cooper To: Raphael Kubo da Costa Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-hackers@freebsd.org 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 00:52:12 -0000 On Sat, Feb 5, 2011 at 3:42 PM, Raphael Kubo da Costa wr= ote: > Garrett Cooper writes: > >> On Sat, Feb 5, 2011 at 11:27 AM, Raphael Kubo da Costa wrote: >>> Hey there, >>> >>> I was working on some code that used devinfo(3). According to devinfo's >>> man page, #including devinfo.h should be enough to use it. However, a >>> program which only #includes devinfo.h fails due to stdint.h (or >>> sys/types.h) not being included, thus giving me some errors about >>> uint32_t and other types not being defined. >>> >>> A few headers in sys/, such as sys/rman.h, have the same problem. >>> >>> Is it a bug in the headers themselves or are the man pages just >>> incorrect? >> >> =A0 =A0 I'd say it's the manpages probably because a lot of the types we= re >> changed to POSIX integral types, and the manpages weren't updated. >> Thanks! > > Hmm. In the case of sys/rman.h, I see that commits using uint32_t and > other such types are almost 10 years old. Older versions of those types were u_int, u_long, etc. Those are the ones that I was referring to in my last reply. > 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/inttype= s.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. Thanks! -Garrett