From owner-svn-src-head@freebsd.org Tue Feb 13 20:09:40 2018 Return-Path: Delivered-To: svn-src-head@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 B7DDDF2029E; Tue, 13 Feb 2018 20:09:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f182.google.com (mail-io0-f182.google.com [209.85.223.182]) (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 576A66E48F; Tue, 13 Feb 2018 20:09:40 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f182.google.com with SMTP id n7so22662483iob.0; Tue, 13 Feb 2018 12:09:40 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=ek02G6ADi+SIr2sj798SOrLWnjKwngPkqkgPgEHoJYc=; b=RimX0GD0hWMbve0QlY3EJ6BwLK3+zZbKxFI+QnCe0uZXFzOAzNjkWC43gRMvBGDx47 9qPwC4vgtbtuG/G1rMlWkI0XTfkw075sx+gt+CfQdsmvqxTwIUtJzzIlGYr953Du+nXW O6yLEUi2SVDCslhi4korqpdKdU1BjE5Yj06GdKQxooY3E7cHEot/s47tD3Y2wtjnqxBw onQbBzZone3F80JYqnQrSqhBwaypmVJmyYP9jWnv+4Af7fr+Z5wLoVQA0BMLO5ljGp2a koQ1R5rg4U3RqZXdgRl0Wrhmh963kk7Ld0ArzchDNJOm7KV7sJJvv38UiCTYpRXFd3XJ wsSg== X-Gm-Message-State: APf1xPCuOUlANzXmIZkDtaAjtRc5rIn6vLzKKR6bEiRk4mLSYjeAL+ZU 4cWp/n2VaRz9d8brn/VGbCsn1XpU X-Google-Smtp-Source: AH8x227MalFyqFSujXMUXVEG5UYCKkvmgwbSHdFj82CD0XX9YrMEzoPGhWuoEGk6E/kxRsckpdHCbw== X-Received: by 10.107.53.22 with SMTP id c22mr2798718ioa.189.1518552574486; Tue, 13 Feb 2018 12:09:34 -0800 (PST) Received: from mail-it0-f42.google.com (mail-it0-f42.google.com. [209.85.214.42]) by smtp.gmail.com with ESMTPSA id x2sm11870804ite.10.2018.02.13.12.09.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 12:09:34 -0800 (PST) Received: by mail-it0-f42.google.com with SMTP id 140so4195785iti.0; Tue, 13 Feb 2018 12:09:34 -0800 (PST) X-Received: by 10.36.192.131 with SMTP id u125mr3026460itf.119.1518552573900; Tue, 13 Feb 2018 12:09:33 -0800 (PST) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.2.30.149 with HTTP; Tue, 13 Feb 2018 12:09:33 -0800 (PST) In-Reply-To: <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> References: <201802131917.w1DJHmso047463@repo.freebsd.org> <1518549829.85310.39.camel@freebsd.org> <1b3a489d-d62c-6f88-a269-a35ad9bf5ef5@vangyzen.net> From: Conrad Meyer Date: Tue, 13 Feb 2018 12:09:33 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r329237 - head/sys/libkern To: Eric van Gyzen Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Feb 2018 20:09:40 -0000 On Tue, Feb 13, 2018 at 11:52 AM, Eric van Gyzen wrote: > On 02/13/2018 13:43, Ed Maste wrote: >> On 13 February 2018 at 14:23, Ian Lepore wrote: >>> 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, >> ... > > I prefer '\0' here because it tells the reader that it's a NUL > character, as opposed to a NULL pointer or a zero integer. Yes, the > reader should already know that, but the author can /help/ the reader by > communicating more clearly and completely. And I prefer 0, because it's easier to type and conveys exactly the same meaning. A character NUL is simply a zero integer of char type. These are standard library string manipulation routines with char pointer types. It is already extremely clear to the reader that the zeros involved are end-of-string sentinels. Best, Conrad