From owner-svn-src-all@freebsd.org Fri Aug 10 18:48:19 2018 Return-Path: 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 89AB11071E56 for ; Fri, 10 Aug 2018 18:48:19 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound1b.ore.mailhop.org (outbound1b.ore.mailhop.org [54.200.247.200]) (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 14C4575E18 for ; Fri, 10 Aug 2018 18:48:19 +0000 (UTC) (envelope-from ian@freebsd.org) X-MHO-RoutePath: aGlwcGll X-MHO-User: ed8b2426-9ccd-11e8-93fa-f3ebd9db2b94 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.ore.mailhop.org (Halon) with ESMTPSA id ed8b2426-9ccd-11e8-93fa-f3ebd9db2b94; Fri, 10 Aug 2018 18:48:10 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id w7AIm9Dt061807; Fri, 10 Aug 2018 12:48:09 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <1533926889.9860.199.camel@freebsd.org> Subject: Re: svn commit: r337426 - head/sbin/ifconfig From: Ian Lepore To: Mark Johnston , Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Date: Fri, 10 Aug 2018 12:48:09 -0600 In-Reply-To: <20180810184426.GB52302@raichu> References: <201808071725.w77HPciT051597@repo.freebsd.org> <20180810092251.K1276@besplex.bde.org> <20180810184426.GB52302@raichu> 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-all@freebsd.org X-Mailman-Version: 2.1.27 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: Fri, 10 Aug 2018 18:48:19 -0000 On Fri, 2018-08-10 at 14:44 -0400, Mark Johnston wrote: > On Fri, Aug 10, 2018 at 10:25:50AM +1000, Bruce Evans wrote: > > > > On Tue, 7 Aug 2018, Mark Johnston wrote: > > > > > > > > Log: > > >  ifconfig: Fix use of _Noreturn. > > > > > >  The _Noreturn is a function-specifier (like inline) which must preceed > > >  the declarator. > > > > > >  Submitted by: Sebastian Huber > > >  MFC after: 1 week > > _Noreturn is even more broken than I knew.  It should never be used.  Here > > its use is wronger than usual. > > > > > > > > Modified: head/sbin/ifconfig/ifconfig.c > > > ============================================================================== > > > --- head/sbin/ifconfig/ifconfig.c Tue Aug  7 17:13:42 2018 (r337425) > > > +++ head/sbin/ifconfig/ifconfig.c Tue Aug  7 17:25:38 2018 (r337426) > > > @@ -109,7 +109,7 @@ static int ifconfig(int argc, char *const *argv, int i > > > static void status(const struct afswtch *afp, const struct sockaddr_dl *sdl, > > > struct ifaddrs *ifa); > > > static void tunnel_status(int s); > > > -static void usage(void) _Noreturn; > > > +static _Noreturn void usage(void); > > > > > > static struct afswtch *af_getbyname(const char *name); > > > static struct afswtch *af_getbyfamily(int af); > > FreeBSD code should use __dead2 since it is more portable (within > > FreeBSD) and doesn't have so mean syntactical restrictions.  However, > > it only exists at all since it had similar syntactial restrictions > > when it was new (FreeBSD-1 used __dead, which must be placed like > > _Noreturn, but __dead2 uses __attribute__(()) which couldn't be placed > > there when it was new), and the macro that hides the details was renamed > > to inhibit misuse.  Changing __dead2 to _Noreturn and moving it to satisfy > > the restricted syntax of the latter mainly broke support for old compilers > > where __dead2 cannot be placed there. > __dead2 was never present.  _Noreturn was added in r317755, apparently > to appease Coverity. > > > > > However, all declarations of static usage() as non-returning are bogus, ... > I can only agree, especially since exit() is already declared with > _Noreturn in stdlib.h.  I don't understand why __dead2/_Noreturn keeps > getting added to various usage() declarations. > It was getting added to appease some not-very-capable static code analyzer. Not Coverity, not clang's builtin analyzer, something else someone was using, I forget the details. -- Ian