From owner-svn-src-head@freebsd.org Sun Jun 24 14:35:35 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 7B13D1001BEC for ; Sun, 24 Jun 2018 14:35:35 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1a.eu.mailhop.org (outbound1a.eu.mailhop.org [52.58.109.202]) (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 E99318BFCC for ; Sun, 24 Jun 2018 14:35:34 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: d4035986-77bb-11e8-aa1a-954dbaed88ca 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 outbound1.eu.mailhop.org (Halon) with ESMTPSA id d4035986-77bb-11e8-aa1a-954dbaed88ca; Sun, 24 Jun 2018 14:35:24 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w5OEZNc2093242; Sun, 24 Jun 2018 08:35:23 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1529850923.24573.69.camel@freebsd.org> Subject: Re: svn commit: r335602 - head/sbin/dhclient From: Ian Lepore To: Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Sun, 24 Jun 2018 08:35:23 -0600 In-Reply-To: <201806241323.w5ODNRW2037739@repo.freebsd.org> References: <201806241323.w5ODNRW2037739@repo.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-head@freebsd.org X-Mailman-Version: 2.1.26 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: Sun, 24 Jun 2018 14:35:35 -0000 On Sun, 2018-06-24 at 13:23 +0000, Eitan Adler wrote: > Author: eadler > Date: Sun Jun 24 13:23:27 2018 > New Revision: 335602 > URL: https://svnweb.freebsd.org/changeset/base/335602 > > Log: >   dhclient: build with WARNS=6 >    >   - add static in a number of places >   - initialize __progname rather than rely on magical extern values >   - use nitems() instead of manually spelling it out >   - unshadow 'idi' >   - teach 'error' that it is '__dead2' >   - add missing 'break' The changes related to __progname aren't correct. __progname is a bsd- ism that goes back to at least 4.4BSD, including the need to locally have an extern char* decl to use it. You changed it to a file-static var definition without changing the name, and names beginning with a double underbar belong to the implementation and shouldn't be used locally. A more correct way to modernize code that uses __progname is to just replace each occurance of it with a call to getprogname(3) (and ensure stdlib.h has been included where it's used). References to the program name are typically not in performance-sensitive code so there's no need to even have a local var. (I think in libc, getprogname() is implemented as "return __progname"). -- Ian