Date: Wed, 14 Feb 2018 16:20:21 +1100 (EST) From: Bruce Evans <brde@optusnet.com.au> To: Ian Lepore <ian@freebsd.org> Cc: Ed Maste <emaste@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r329237 - head/sys/libkern Message-ID: <20180214160048.E1450@besplex.bde.org> In-Reply-To: <1518551679.72050.4.camel@freebsd.org> References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> <CAPyFy2Cckiz8iBzy664-%2BpVCPJhmxdD_JmzmEpSo5WFV-b8DEA@mail.gmail.com> <1518551679.72050.4.camel@freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 13 Feb 2018, Ian Lepore wrote: > On Tue, 2018-02-13 at 14:43 -0500, Ed Maste wrote: >> On 13 February 2018 at 14:23, Ian Lepore <ian@freebsd.org> 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: >>>> =A0 libkern: use nul for terminating char rather than 0 >>>> >>>> =A0 Akin to the change made in r188080 for lib/libc/string/. >>>> >>>> =A0 Reported by:=A0=A0=A0=A0=A0=A0=A0=A0bde >>>> =A0 Sponsored by:=A0=A0=A0=A0=A0=A0=A0The FreeBSD Foundation >>> There are many ways to spell 0.=A0=A0Why are we using something other >>> than >>> the simplest way?=A0=A0Is it a style rule thing, or is it portability- >>> correctness, or what? style(9) requires '\0' (by always spelling the character constant with value 0 like that). >> 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.) Core parts of libc like stdio and (MI) string use '\0' fairly consistently. There were about 10-20 plain 0's in string in FreeBSD-5, but most of these have been changed to '\0'. This gives a much larger set of examples of normal style. > Oh, I agree completely about consistancy being important. =A0I 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. =A0Then 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). Probably the BSD style rule has the same origin. Bruce From owner-svn-src-all@freebsd.org Wed Feb 14 06:19:15 2018 Return-Path: <owner-svn-src-all@freebsd.org> 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 CE2A8F03D76; Wed, 14 Feb 2018 06:19:15 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: from mail-io0-x241.google.com (mail-io0-x241.google.com [IPv6:2607:f8b0:4001:c06::241]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 539398627B; Wed, 14 Feb 2018 06:19:15 +0000 (UTC) (envelope-from antoine.brodin.freebsd@gmail.com) Received: by mail-io0-x241.google.com with SMTP id d13so23978851iog.5; Tue, 13 Feb 2018 22:19:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=Q24D08PLB+VMpZdmFuKySDriX7hpl1Mr9E4ht/thHsc=; b=jQ8eg59ImzXq+oZfzWBp7SO84QQyE3jnrdzGILjOQ1W8W+c5ajo8yhJhOqqEMyeMFg vnqYyRCQn8IDHviUefU+9HFvnLHVWTa1T0atgVcH4/B2oboU9ml4RnEevWQZBINX6LbI JiZCWfuaaPDPJ7I4QJaygyslmYzvFfsCPoV8aLrPj8AwyhQsUlT74IBFSGdbZP3kY+FM SGIva3kT47T0jPYgQ0O7TYLeFn3r4W09vRsz27U3vN0G4sZa7H9Ch35cfcQiV0y3Uiu1 mc5GNxdaoKLVAlo8xav3ShlBlWI8g29yKkLvQtAwRVvpR+bEPOP7jNqnkZtiKlprX20d A1bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=Q24D08PLB+VMpZdmFuKySDriX7hpl1Mr9E4ht/thHsc=; b=K+zhqF1SZv8dzpFmJAdkYB0hlIR9Xhl949otAwgqjeiJh8ryu+8HdoVwGuXjVnHgoj kcAoqtozPkysipX6ZFj5GQaBtFCGoWCvqgLe+8r3EswqVN6G6Wng1yQffFnn67cGTYwO t2WZkg/7fPcPmButa9po/oobUgwtV79KPluiL57AqU/RVMz9Sw4GnvjJri+ZjXSJqoi6 /6ttHEZI9CYvWs5Q7OFCvIzU8fwS1T7Sp4GsgsyEtbs2OKOu9gbvbgHUBp5oLSdBwKA+ Hm+virIp1puLJ2gKwGsBRhheEy3Gph0Bmv2ZtsHL1aYIqJFlb1vc+j/Ce4EPheGXriv3 2fCA== X-Gm-Message-State: APf1xPDFwfsDXzM6bSxADFRQkhSTiMTBDyaEU1CTrgrcCtFDSBwCtN+q LT3sMihXgO80EYYvWYZY4oIXDd2OCOip4tZN71J1UA== X-Google-Smtp-Source: AH8x226uL80RZv+09Ci2dy0sgMQAjj2WlokincCACt/02L1lU6yLXGCUc4cLGjrBDhgllIbYQHW2x/uJrfO1wPyi08A= X-Received: by 10.107.27.19 with SMTP id b19mr4322851iob.202.1518589154550; Tue, 13 Feb 2018 22:19:14 -0800 (PST) MIME-Version: 1.0 Sender: antoine.brodin.freebsd@gmail.com Received: by 10.107.143.86 with HTTP; Tue, 13 Feb 2018 22:19:14 -0800 (PST) In-Reply-To: <201802132243.w1DMh7IY054400@repo.freebsd.org> References: <201802132243.w1DMh7IY054400@repo.freebsd.org> From: Antoine Brodin <antoine@freebsd.org> Date: Wed, 14 Feb 2018 07:19:14 +0100 X-Google-Sender-Auth: 6rDv9OxtqGB8_HhB8lx3NR8ah3Y Message-ID: <CAALwa8nA72saTJX0OmUhxukVu8s51=chRshoGX1X_Omq2pcVYQ@mail.gmail.com> Subject: Re: svn commit: r329249 - in stable/11: cddl/contrib/opensolaris/cmd/dtrace/test/tst/common/safety cddl/contrib/opensolaris/lib/libdtrace/common cddl/usr.sbin/dtrace/tests/common/safety cddl/usr.sbin/d... To: Mark Johnston <markj@freebsd.org> Cc: src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Content-Type: text/plain; charset="UTF-8" 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" \)" <svn-src-all.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/svn-src-all>, <mailto:svn-src-all-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/svn-src-all/> List-Post: <mailto:svn-src-all@freebsd.org> List-Help: <mailto:svn-src-all-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/svn-src-all>, <mailto:svn-src-all-request@freebsd.org?subject=subscribe> X-List-Received-Date: Wed, 14 Feb 2018 06:19:16 -0000 On Tue, Feb 13, 2018 at 11:43 PM, Mark Johnston <markj@freebsd.org> wrote: > Author: markj > Date: Tue Feb 13 22:43:07 2018 > New Revision: 329249 > URL: https://svnweb.freebsd.org/changeset/base/329249 > > Log: > MFC r327888, r327972, r327973: > Add "jid" and "jailname" variables to DTrace. > Hi, stable/11 fails to build: /poudriere/jails/11stable-amd64/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c:316:19: error: use of undeclared identifier 'DT_VERS_1_13' DT_ATTR_STABCMN, DT_VERS_1_13, &dt_idops_type, "string" }, ^ /poudriere/jails/11stable-amd64/usr/src/cddl/contrib/opensolaris/lib/libdtrace/common/dt_open.c:317:60: error: use of undeclared identifier 'DT_VERS_1_13' { "jid", DT_IDENT_SCALAR, 0, DIF_VAR_JID, DT_ATTR_STABCMN, DT_VERS_1_13, ^ 2 errors generated. Antoine
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180214160048.E1450>