Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 5 Feb 2011 16:52:09 -0800
From:      Garrett Cooper <gcooper@FreeBSD.org>
To:        Raphael Kubo da Costa <kubito@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Missing stdint.h includes?
Message-ID:  <AANLkTinb49f6jq73BoxTiMOZhmS=Tc%2BdwP8juuv2%2BOt4@mail.gmail.com>
In-Reply-To: <87fws2rqui.fsf@gmail.com>
References:  <87vd0ys2no.fsf@gmail.com> <AANLkTimS-Ue_HmZ-rbU7k0WnmCFU9hns2KSo_ZiESkgQ@mail.gmail.com> <87fws2rqui.fsf@gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Feb 5, 2011 at 3:42 PM, Raphael Kubo da Costa <kubito@gmail.com> wr=
ote:
> Garrett Cooper <yanegomi@gmail.com> writes:
>
>> On Sat, Feb 5, 2011 at 11:27 AM, Raphael Kubo da Costa <kubito@gmail.com=
> 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTinb49f6jq73BoxTiMOZhmS=Tc%2BdwP8juuv2%2BOt4>