From owner-svn-src-all@freebsd.org Tue Feb 21 00:32:42 2017 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 2C1C8CE67AF for ; Tue, 21 Feb 2017 00:32:42 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm5-vm2.bullet.mail.ne1.yahoo.com (nm5-vm2.bullet.mail.ne1.yahoo.com [98.138.90.153]) (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 E9FA57BD for ; Tue, 21 Feb 2017 00:32:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1487637160; bh=5OF11/NXmIVSunEUZdnToZ8ydoMECGFYfXZZVI1svKM=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=Dkc3RdY1KwPpQgrv2Dhvu3eQkZER/86jz708Gxy8mCeNCxKCGZpbQJHZxrfslgfx4ywWKE8ifM0/1yRd5sRZU2opwj8PBtckiNLnrK7le4Ddn/G8A9fiy9OEMnFEqWUq6Yxutsf6gZvxsz/OsWASUOzuHMwdeJ1HIsWJHB5pzGJjbrwHd+Ymk4z/NlIet02OmhJ5QCn4FAXRCYPkILF7P1feVelhya8jOlk3CtlJPv9sDfl6e++l/0hSXGqtjRDfkXKw8FED+LHAul7Ccgc++7CLqsYHmT17qFoSTfYQiJomx9xnqMaFLdpnNd3JKUGmDlhXH98bywOqMVzlEXC8rw== Received: from [98.138.100.117] by nm5.bullet.mail.ne1.yahoo.com with NNFMP; 21 Feb 2017 00:32:40 -0000 Received: from [98.138.226.131] by tm108.bullet.mail.ne1.yahoo.com with NNFMP; 21 Feb 2017 00:32:40 -0000 Received: from [127.0.0.1] by smtp218.mail.ne1.yahoo.com with NNFMP; 21 Feb 2017 00:32:40 -0000 X-Yahoo-Newman-Id: 204998.15825.bm@smtp218.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: JmNkBy4VM1ltnwx6kT3LTk8b4PI1dl5v2yJEc3gdQGhTm_f g7ZHCB.bq2LehrDOHny.DdLJuU6ioVuTZY6cPoiK3PRhE_Qhfp2qFD0L6_EP T9njRxJA90cBFE2i8Oug8Wrnin0cKpsAJPDUuOBenUF1OKsz0UqH1CXm8K.W zyoSeNOLYkP.4yexqim6RR0WQ4E7sBpzOKtzn0SP5MZg.1guxAENxxdccUYY zdWvevlQMCluO9kLbgW2VDVoZkbrN6W7Q3DUgUVAt28in_AUPbeuCnclE9_h V_0j.WP.wrhpKzpb2kDt7J1Cm2IrLnMSb3bRTy09_PvAC.uh9F4nH6Z4cH6Q 8QNCqJAgIkt95wKZMyzQOVjP0NnyC7URwWdx4Wnz.cA_kA2hGWzlt1VYa5tj qERAW99lSbahxBLBZjqGFHU6pKEKi7.I2u90RHsb3Jfv3wW386D2ocyS.r1U xxNzJAaxpMeE3ValcEwvkbFbHeYMjpCmZv5Lb0w.p6jK4IlfNuUTirJWk5pD l8aoQ7o4B6RzXn0eZFkkjqoha7QiM_LXlepa7E7a_.pZSiDA- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r313982 - in head/sys/dev: agp al_eth an arcmsr bce beri/virtio bhnd/cores/usb buslogic ce cm cp ctau cx de ed fatm fe firewire hptiop hptmv iicbus isp le md ncr netmap ofw patm pccard ... To: cem@freebsd.org References: <201702200343.v1K3hCk3060716@repo.freebsd.org> Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org From: Pedro Giffuni Message-ID: <1d213a3f-ea84-256c-e08b-e5e100ef83ba@FreeBSD.org> Date: Mon, 20 Feb 2017 19:35:20 -0500 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; 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: Tue, 21 Feb 2017 00:32:42 -0000 Hello; Just been discussing the same issue in private as well ... On 2/20/2017 6:40 PM, Conrad Meyer wrote: > On Sun, Feb 19, 2017 at 7:43 PM, Pedro F. Giffuni wrote: >> Author: pfg >> Date: Mon Feb 20 03:43:12 2017 >> New Revision: 313982 >> URL: https://svnweb.freebsd.org/changeset/base/313982 >> >> Log: >> sys/dev: Replace zero with NULL for pointers. >> >> Makes things easier to read, plus architectures may set NULL to something >> different than zero. > Hi Pedro, > > I like the change for style reasons. > > The comment about architectures with non-zero NULL is a little > misleading, though. This change has no impact on non-zero bit pattern > NULL architectures. The zero pointer value in C is NULL and NULL is > the zero pointer value in C. It may have a bit pattern other than > zero (i.e., printf("%p", NULL) may be non-zero and memset(&p, 0, > sizeof(p)) is bogus in portable code) but assigning the logical zero > value is always legitimate. Grrr ... yes the comment is/was misleading: I would undo it if I didn't have to revert the commit with it. Other project have SVN configured to permit changing the log message BTW. > After all, NULL is just a casted zero value: > > #define NULL ((void *)0) The compiler is pretty good at detecting when the value is a pointer though. The change has few (if any) effect on real life but coming from the days where most computer languages were somewhat stronger typed I really like to be able to distinguish between a zero valued pointer and a zero valued int. > Maybe this is moot. I don't believe any architecture FreeBSD actually > supports has non-zero bitpattern NULL, but something weird like CHERI > might. Such "weird" platforms are starting to appear: https://reviews.llvm.org/D26196 Regards, Pedro.