From owner-svn-src-all@freebsd.org Tue Feb 13 19:54:48 2018 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id BAF1CF1F1DA for ; Tue, 13 Feb 2018 19:54:48 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from pmta2.delivery6.ore.mailhop.org (pmta2.delivery6.ore.mailhop.org [54.200.129.228]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46B036D78E for ; Tue, 13 Feb 2018 19:54:47 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-User: ac67eb81-10f7-11e8-b951-f99fef315fd9 X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (unknown [67.177.211.60]) by outbound2.ore.mailhop.org (Halon) with ESMTPSA id ac67eb81-10f7-11e8-b951-f99fef315fd9; Tue, 13 Feb 2018 19:54:17 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w1DJsdSs038527; Tue, 13 Feb 2018 12:54:39 -0700 (MST) (envelope-from ian@freebsd.org) Message-ID: <1518551679.72050.4.camel@freebsd.org> Subject: Re: svn commit: r329237 - head/sys/libkern From: Ian Lepore To: Ed Maste Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Tue, 13 Feb 2018 12:54:39 -0700 In-Reply-To: References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.1 FreeBSD GNOME Team Port Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 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, 13 Feb 2018 19:54:48 -0000 On Tue, 2018-02-13 at 14:43 -0500, Ed Maste wrote: > On 13 February 2018 at 14:23, Ian Lepore wrote: > > > > On Tue, 2018-02-13 at 19:17 +0000, Ed Maste wrote: > > > > > > Author: emaste > > > Date: Tue Feb 13 19:17:48 2018 > > > New Revision: 329237 > > > URL: https://svnweb.freebsd.org/changeset/base/329237 > > > > > > Log: > > >   libkern: use nul for terminating char rather than 0 > > > > > >   Akin to the change made in r188080 for lib/libc/string/. > > > > > >   Reported by:        bde > > >   Sponsored by:       The FreeBSD Foundation > > There are many ways to spell 0.  Why are we using something other > > than > > the simplest way?  Is it a style rule thing, or is it portability- > > correctness, or what? > I made the change to improve consistency between lib/libc/string and > sys/libkern, which is what Bruce commented on some time ago. I don't > have a personal preference for 0 or '\0' but definitely believe that > if we have multiple, similar copies of a function they ought to avoid > gratuitous differences. (I'm happy to change both trees to 0 if > that's > preferred.) > Oh, I agree completely about consistancy being important.  I just wanted to know whether I should try to remember to always use \0 because it's a rule or has some benefit I didn't know about. 20+ years ago I used to slavishly ensure I always used \0 when a char type was involved, just as a personal style thing.  Then over time I came to the conclusion that "0 is 0 no matter how you spell it, so keep it simple" (except for pointers... even in c++ I've always used NULL). -- Ian