From owner-svn-src-all@FreeBSD.ORG Tue May 19 15:58:30 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 66CED50E for ; Tue, 19 May 2015 15:58:30 +0000 (UTC) Received: from nm26-vm0.bullet.mail.bf1.yahoo.com (nm26-vm0.bullet.mail.bf1.yahoo.com [98.139.213.74]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 242671FC6 for ; Tue, 19 May 2015 15:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1432051108; bh=iF7+j7ysBjJWI0KzvizF25MmcRn931zgXvYLlOh4G/k=; h=Date:From:To:CC:Subject:References:In-Reply-To:From:Subject; b=FbNMSKSBnkCpFSzw763ZfCjGtPnkZmigoo5BqHw90yJvWfbrREOBPiawheNpoaG59/nnQIO8jIRTBt3EnRieRfGOVrNKtqGvXBcSt8E/t38sJk23PEoeQ9WkUtJY+L7DmgJ17DpGqU3uaPWXl5qpnP0SZ4Z3XzBQBPWhyFva5lFS86TlrPSNOTRWa3F8Hr9o9wkdAOyhzb77pB9qhOPYIEaJ9sBS1c9VkubPgJfbxrgpoGBxokqq7A1j2ZHQgI5jK0fD0NAaLOPZ00T8YHTw/JvzXch278+rQCuQMhJeny5UPYRaY1hdOoOkJ/Ho+UqnElc9IJ8Z7SlVNp+ds7a49g== Received: from [98.139.215.141] by nm26.bullet.mail.bf1.yahoo.com with NNFMP; 19 May 2015 15:58:28 -0000 Received: from [98.139.213.15] by tm12.bullet.mail.bf1.yahoo.com with NNFMP; 19 May 2015 15:58:28 -0000 Received: from [127.0.0.1] by smtp115.mail.bf1.yahoo.com with NNFMP; 19 May 2015 15:58:28 -0000 X-Yahoo-Newman-Id: 238177.23413.bm@smtp115.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: N.R5LiUVM1lIJZ.3fWGZ8gZpRLzPVHGjv6eRCK4sxuAMDDE SBtMO2oOte4sdUB.y5MDb7QzEtAoQEUmRiRLdLBffb6eSLKDJMlbkYLjizNw x9.0q7Fg3SgcsI14lGB5nMSkRQ0yIttVLknIh20.hESUB_vvWbQrzzQsCyon 3J.F_KPGifXdz6g8J1qgDGO0TzSj6J7mIHoziqqwev_zyrFIiTf.Wr3aazrA _1vjblFWCxyOPlFIkojnVgepb5wDk7DejCOfw97wqB9gg.Tc8eTS4l8Q01X4 rvAfCpHr_NS_Q70frgwkzWsCfF0uk3GSfNw3eQk4WgigactVn2ikPMQo9Sho tPkAIsCbVQPVlO3ImUKAEsanvbhXjnLDQyv3NlHCOVIuCzj5Dqpi71x_9KpX 2j5LQOlndsl8N3zMGrpRxg9FcMuDGSlk5nXBGDA4BWL5oeCEPNUOhbv5qKma JnAEdGaQYvV2uHtsb96Zi0YQNxNoNSZeDQhRHFYzPVPB4tzDms9RpwmTFOzp j.yBJFd2DvavaK.yti2B0DDCpHEUbvFxy X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Message-ID: <555B5DA7.5000207@FreeBSD.org> Date: Tue, 19 May 2015 10:58:31 -0500 From: Pedro Giffuni User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: John Baldwin CC: Bruce Evans , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r283088 - head/sys/ddb References: <201505182227.t4IMRljx078812@svn.freebsd.org> <20150519135341.R2157@besplex.bde.org> <2053555.dpIzi23R03@ralph.baldwin.cx> In-Reply-To: <2053555.dpIzi23R03@ralph.baldwin.cx> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 19 May 2015 15:58:30 -0000 On 05/19/15 08:45, John Baldwin wrote: > On Tuesday, May 19, 2015 12:28:05 AM Pedro Giffuni wrote: >>>>>> Modified: head/sys/ddb/db_break.c >>>>>> ============================================================================== >>>>>> --- head/sys/ddb/db_break.c Mon May 18 22:14:06 2015 (r283087) >>>>>> +++ head/sys/ddb/db_break.c Mon May 18 22:27:46 2015 (r283088) >>>>>> @@ -155,12 +155,12 @@ db_find_breakpoint_here(db_addr_t addr) >>>>>> return db_find_breakpoint(db_map_addr(addr), addr); >>>>>> } >>>>>> >>>>>> -static boolean_t db_breakpoints_inserted = TRUE; >>>>>> +static boolean_t db_breakpoints_inserted = true; >>>>> This code hasn't been churned to use the boolean type. It still uses >>>>> boolean_t, which is plain int. TRUE and FALSE go with this type. true >>>>> and false go with the boolean type. This probably makes no difference, >>>>> because TRUE happens to be implemented with the same value as true and >>>>> there are lots of implicit versions between the types. >>>> Yes, I noticed the return types are still ints. It doesn’t look difficult >>>> to convert it to use a real boolean type. In any case, I would prefer to go >>>> forward (using bool) instead of reverting this change. >>> That wuld be sideways. >>> >>> I forgot to mention (again) in my previous reply that boolean_t is a mistake >>> by me. KNF code doesn't even use the ! operator, but uses explicit >>> comparison with 0. The boolean_t type and TRUE and FALSE are from Mach. >>> They were used mainly in ddb and vm, and are still almost never used in >>> kern. I used to like typedefs and a typedef for boolean types, and didn't >>> know KNF very well, so in 1995 I moved the declaration of boolean_t from >>> Mach vm code to sys/types.h to try to popularize it. This was a mistake. >>> Fortunately, it is still rarely used in core kernel code. >>> >>> The boolean type is also almost never used for syscalls. In POSIX.1-2001, >>> is inherited from C99, but is never used for any other POSIX >>> API. Using it for syscalls would mainly cause portability problems. >>> >> OK, I do understand the kernel wants to keep the C dialect somewhat limited, >> and adding stdbool.h doesn’t buy us any type safety here. >> >> I’ll revert the change (prob. tomorrow though). > I will disagree with Bruce a bit and put my vote in for replacing boolean_t > with bool where it is used. I do think that logically (if not strictly) your > commit is a type mismatch as TRUE/FALSE is for boolean_t and true/false are > for bool. I agree with Bruce that we probably don't want to use bool for > system calls. However, I think using bool in the kernel itself is ok and that > we should replace boolean_t with bool. > I guess it boils down to the dilemma between modernity and common practice. OK, I know the current change can't stay as-is, and even Bruce admits that boolean_t is a mistake, so I think I will give the bool a try. Thanks for the feedback! Pedro.