From owner-svn-src-all@freebsd.org Mon Aug 1 16:08:48 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 8BFEEBABF48 for ; Mon, 1 Aug 2016 16:08:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from nm6.bullet.mail.bf1.yahoo.com (nm6.bullet.mail.bf1.yahoo.com [98.139.212.165]) (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 43DB51DEF for ; Mon, 1 Aug 2016 16:08:48 +0000 (UTC) (envelope-from pfg@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1470067720; bh=rS28cQSZUSupZnNtq+E1HxsRtg++CRuiiGktuBQDk1k=; h=Subject:To:References:Cc:From:Date:In-Reply-To:From:Subject; b=HG+Duq7X2t5/ptdEDuhGZzyWE8bEUiYsy2enNEito3LCY16filMemk+EHVc9fIMOwSRpVczvwF+WnijELIMSl7Hhe9GommWeFcI68scMHrxXvQVf+hXgNMY3fCnj5OG0JqzfPI/O9PP8s4Mc18O8g21HGGxlWVkm4z8Qh9w8Gqrfm3DRUrEdNK6tJvrgjGbWdo8IVCEA+VTBUcUscj8zCxjTwrFWHqJAdtIAP7gjJwtav78flY/FzZbACHz97sGzAUfkTpZqhLsihwNqKeA8adui07wdFF/YYNaVVIWkPdVo6XzjqMjdbivulrK30tEjDdP1COMbKrBDJdRo3OYIrA== Received: from [66.196.81.173] by nm6.bullet.mail.bf1.yahoo.com with NNFMP; 01 Aug 2016 16:08:40 -0000 Received: from [68.142.230.65] by tm19.bullet.mail.bf1.yahoo.com with NNFMP; 01 Aug 2016 16:08:40 -0000 Received: from [127.0.0.1] by smtp222.mail.bf1.yahoo.com with NNFMP; 01 Aug 2016 16:08:40 -0000 X-Yahoo-Newman-Id: 767651.27885.bm@smtp222.mail.bf1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: FOo2kRMVM1nGlWWEMYCkzMLIa1wzNzx7reHV8Tgs7Ya7idw A1FomZFW898e_OzedC2xZYlZASF61out73X6eaKwF7sEECKx23Y36RUuwQ0X Joi3lNvTRoociC7ULZKpnz6y7BQkKTkx2NDmD3EwXM9wawzD2_FeWsui.y1J evt9g_WryhDGBO9kDrPWdzgrTh4dRHbF0E4cMXh1kznSWVmMJnDx2SvkVD3o eK.MvBAjUk1ZLSzDC9t_JNUo194V0kDiV0ENl912v.zBeMx7uoQe6kBS3mhP Di0fEA0crtLalPvrZxIMw.JBb2RmMlmADhdUjC72jcsM6X7MyRM9jgwZfrJf Q7zdsBhFMjvN8xeHr5wWTnCwSeJWylziqvzk9Z1zHLmt_6j0ZQM6I_0vYiP6 FoZnSmTRzC_j_inPBg8RNMJgkkGkIgbBdGSYhvKQHkbIykrciVvMPV52.DsS D8FcvHRBckEjDcLKWcylYGE1vXgBljk3P2IGtSZe6mBeFK6jrDuZzyS_J5JJ HCBdH.zGNmwj2KLqkyJBL7wonL7he_Tf2DK1dsZ9h8lBLVQ-- X-Yahoo-SMTP: xcjD0guswBAZaPPIbxpWwLcp9Unf Subject: Re: svn commit: r303600 - head/usr.bin/indent To: Bruce Evans , Xin Li References: <201607312136.u6VLaeRb058693@repo.freebsd.org> <8d6114b7-cd71-239a-dcc4-03a6d568482c@delphij.net> <20160801155148.I884@besplex.bde.org> Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org, d@delphij.net From: Pedro Giffuni Message-ID: <809fadc7-0ac1-2f50-1d77-588e1b756302@FreeBSD.org> Date: Mon, 1 Aug 2016 11:08:51 -0500 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <20160801155148.I884@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.22 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: Mon, 01 Aug 2016 16:08:48 -0000 On 08/01/16 01:08, Bruce Evans wrote: > On Sun, 31 Jul 2016, Xin Li wrote: > >> On 7/31/16 14:36, Pedro F. Giffuni wrote: >>> >>> Log: >>> indent(1): replace function call to bzero with memset. >>> >>> Reference: >>> >>> https://github.com/pstef/freebsd_indent/commit/7422f42f80099c69d34833d7106035dc09230235 >>> >>> >>> Differential Revision: https://reviews.freebsd.org/D6966 (Partial) >>> Submitted by: Piotr Stefaniak >>> >>> Modified: >>> head/usr.bin/indent/io.c >>> >>> Modified: head/usr.bin/indent/io.c >>> ============================================================================== >>> >>> --- head/usr.bin/indent/io.c Sun Jul 31 21:29:10 2016 (r303599) >>> +++ head/usr.bin/indent/io.c Sun Jul 31 21:36:40 2016 (r303600) >>> @@ -629,7 +629,7 @@ parsefont(struct fstate *f, const char * >>> const char *s = s0; >>> int sizedelta = 0; >>> >>> - bzero(f, sizeof *f); >>> + memset(f, 0, sizeof(struct fstate)); >> ^^^^^^^^^^^^^^^^^^^^^ This is much more error-prone >> than sizeof(*f) IMHO. > > I also prefer bzero(). > bzero --> memset changes are done to ease portability ... On another BSD such replacements were done for performance but then they discovered it was their bzero that was broken. > Removal of the space after sizeof is another regression. KNF disallows > the space, but indent's style is very far from KNF. It isn't clear if > indent's style is to require the space, since old versions of indent > never used sizeof(typename), and 'sizeof object' requires the space. > Regressions started in r93440 with sizeof(object) in an nitems() expansion. OK ... that was in 2002. We are using nitems() now, which undoes the portability meant to be brought by memset. OTOH, using sys/param.h is implicit permission to use nitems() and may involve other portability issues already. Can't keep everybody happy. Pedro.