From owner-svn-src-all@freebsd.org Fri Sep 9 16:27:54 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 44FEDBD2986 for ; Fri, 9 Sep 2016 16:27:54 +0000 (UTC) (envelope-from pfg@apache.org) Received: from nm13-vm0.bullet.mail.bf1.yahoo.com (nm13-vm0.bullet.mail.bf1.yahoo.com [98.139.213.79]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id F173A872 for ; Fri, 9 Sep 2016 16:27:53 +0000 (UTC) (envelope-from pfg@apache.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1473438466; bh=vPiPLrEUKJey3MRKs8TTneqX0w4e5zQEju1UyQqTA0Q=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=k8N0n5E++cFiaPf0hjzFBHfJUlRNG1J0GkuwAimqZBQNpefzGUA3MKVBgFROlYv3JdokctSWvSvD9btgIRtoL2lTQyYhkUePqbsG4Qg9Ow22N34oaSOjCahAXvaEwBCrNaZ8vXZc7bUz12TQldsRSG/8hSupmKb47WalzTuJPx1Fba7pbKQHQhzJtjYrElV91VU3c+Sm46leEWpUoldiCzwWbzvsilU1rjXDb1dY8XjTfhT1atXedFycqXdl/TtIcl5V6qPFM5hVZKSjjWy6ZGICvr4fjmOWxc45/KdeDNFjm1rZGa9aEEUz5Ys+yl5YCsoga9yVkVnqcYkKoEBGuA== Received: from [98.139.170.179] by nm13.bullet.mail.bf1.yahoo.com with NNFMP; 09 Sep 2016 16:27:46 -0000 Received: from [98.139.213.14] by tm22.bullet.mail.bf1.yahoo.com with NNFMP; 09 Sep 2016 16:27:46 -0000 Received: from [127.0.0.1] by smtp114.mail.bf1.yahoo.com with NNFMP; 09 Sep 2016 16:27:46 -0000 X-Yahoo-Newman-Id: 411001.47212.bm@smtp114.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: 50ppjCkVM1n6shYqnEk_9nidrUKazEoLULZeL1a8ZHOSKxb ZU6fSa6Win3bJobBAV97bXKOXZxKj6ejtG5aXqiNEDofiGrtbCqn0OP9szlf hWOaJKqmoHPKJLQAsEkLAaDm3EpwH5pCBSbWz3N0b9q.j5AOwtjMEh0wlkeU aOkaFaVeYJvPu5KNKMlV2My9ANLQAzaKeumXp.A8HQ.EEiTvthGjPHCxjTms 8QwAP34prDPN_m2ggSLowlF.iHp7v2VNcKrhC.D4SZbmDv0lQqHXwJ_9RPIB p3F87F8c1YKBMdHLFpYK8SfSXZqYKXToVNtGsvj4NA.RLY_GzYE9j52mLPxu 5KJy26smLS9v4oepoPxl6qbA4Ev9u4xLjUN_0qh_4B7zHXvZfvOmOb0V.DY9 0gViSYmUWC_eC.XUstKj7RAsfv.NyqjkGxrIwM.0obGaFf.7NTZQ5ZUOsAcv qqUv1sqa.OqIYaXwVSIWyRGSfegkj3uL7XpmCWhUvEIpGKeDlb.yxCF7p.e0 3dEbSCC0YzfauMg76.J7hfX_DGZoSRcUKJjWbf64f3WUl X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r305636 - head/sys/ddb To: Bruce Evans , Justin Hibbits References: <201609090416.u894GriK087316@repo.freebsd.org> <20160909142012.W864@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Organization: Apache Software Foundation Message-ID: <4672379f-5288-8fac-29ac-dcc655bfe12a@apache.org> Date: Fri, 9 Sep 2016 11:27:46 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160909142012.W864@besplex.bde.org> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Fri, 09 Sep 2016 16:27:54 -0000 Hello; On 09/09/2016 00:27, Bruce Evans wrote: > On Fri, 9 Sep 2016, Justin Hibbits wrote: > >> Log: >> Correct the type of db_cmd_loop_done. >> >> On big endian hardware that uses 1 byte bool a type mismatch of bool >> vs int will >> cause the least signifcant byte of db_cmd_loop_done to be set, but >> the MSB to be >> read, and read as 0. This causes ddb to stay in an infinite loop. > > Hrmph. I objected to converting ddb to bool. > True. Changing to bool also uncovered some missing ANSIfication though. >> Modified: head/sys/ddb/db_command.c >> ============================================================================== >> >> --- head/sys/ddb/db_command.c Fri Sep 9 02:02:13 2016 (r305635) >> +++ head/sys/ddb/db_command.c Fri Sep 9 04:16:53 2016 (r305636) >> @@ -59,7 +59,7 @@ __FBSDID("$FreeBSD$"); >> /* >> * Exported global variables >> */ >> -bool db_cmd_loop_done; >> +int db_cmd_loop_done; >> db_addr_t db_dot; >> db_addr_t db_last_addr; >> db_addr_t db_prev; > > It used to use boolean_t, but was misinitialized with 0 and 1 instead of > FALSE and TRUE. Then it used bool, but was misinitialized with 0 and 1 > instead of false and true. Now it is initialized with matching types > for the literals, but its type regressed 2 steps. > > But what was the problem? (int)1 (or any nonzero value) is converted > to (bool)true on assigment. The final value is always 1 if converted > back to an int, and probably also when viewed as bits in memory. When > bool has 8 bits big endian, this means that it has bits 0b00000001 > where you can't really know the bit order within a byte. > Changing to bool unhides type mismatches. It may cause pain now but on the long run it may be better ... I think. It's a shame this will still hit 11.0 though. Pedro.