Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 Mar 2013 21:41:05 +0100
From:      Attilio Rao <attilio@freebsd.org>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Davide Italiano <davide@freebsd.org>, svn-src-projects@freebsd.org, src-committers@freebsd.org
Subject:   Re: svn commit: r247710 - projects/calloutng/sys/kern
Message-ID:  <CAJ-FndBvLD_fU1ZZ3cGNtChfdtXyuBRt4Z_ci8daS08ZYdOKzg@mail.gmail.com>
In-Reply-To: <201303041521.06557.jhb@freebsd.org>
References:  <201303031339.r23DdsBU047737@svn.freebsd.org> <201303041040.41845.jhb@freebsd.org> <CACYV=-HXz2eaCHkA6MhCR1H1Lb7uyASCQd6k-7zYVa46i%2Bvq-g@mail.gmail.com> <201303041521.06557.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, Mar 4, 2013 at 9:21 PM, John Baldwin <jhb@freebsd.org> wrote:
> On Monday, March 04, 2013 3:17:30 pm Davide Italiano wrote:
>> On Mon, Mar 4, 2013 at 4:40 PM, John Baldwin <jhb@freebsd.org> wrote:
>> > On Sunday, March 03, 2013 8:39:54 am Davide Italiano wrote:
>> >> Author: davide
>> >> Date: Sun Mar  3 13:39:54 2013
>> >> New Revision: 247710
>> >> URL: http://svnweb.freebsd.org/changeset/base/247710
>> >>
>> >> Log:
>> >>   - Use TRUE/FALSE in lieu of 0/1 for boolean_t variables.
>> >
>> > We have stdbool in the kernel.  Why not use that instead of the Machish
>> > boolean_t?
>> >
>> > --
>> > John Baldwin
>>
>> It was originally int, and a couple of days ago Attilio suggested to
>> move to 'boolean_t'.
>> Honestly, I didn't argue due to the relative little relevance of the
>> change, but actually I find the type change more explicative.
>> I have no strong objections to change it again (in particular because
>> I think you're suggesting to use bool to be C99 compliant, feel free
>> to correct me if I'm wrong).
>>
>> While here. After closer looking I realized boolean_t is widely used
>> in the kernel (e.g. sys/kern/). Is this just a common error or is
>> there something I'm missing?
>
> No, it's just older and bool is C99 as you noticed.  I had thought that
> boolean_t was largely regulated to code from Mach (i.e. sys/vm) and that
> we should use bool for new code.

Actually boolean_t is much more widespread in our kernel than the C99
variant. Moreover style(9) doesn't advertise it either, neither the
necessity to conform to library defined C99 features (even if present
in the C99 standard, _Bool is still defined in stdbool.h which is an
header not present in our kernel).

I wonder how much style(9) can change over the time. Maybe it is time
to add/update few rules to better comply with new standard adds.

Attilio


-- 
Peace can only be achieved by understanding - A. Einstein



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-FndBvLD_fU1ZZ3cGNtChfdtXyuBRt4Z_ci8daS08ZYdOKzg>