From owner-svn-src-head@freebsd.org Fri Aug 10 18:44:31 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 8A0FF1071DA5; Fri, 10 Aug 2018 18:44:31 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-pl0-x243.google.com (mail-pl0-x243.google.com [IPv6:2607:f8b0:400e:c01::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id E4C7D75C73; Fri, 10 Aug 2018 18:44:30 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-pl0-x243.google.com with SMTP id b90-v6so4402263plb.0; Fri, 10 Aug 2018 11:44:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=wVoM3c/E0PalfRN1hpBEozujTlIGuGQofjRDPx3oYuQ=; b=uYVPmDVDbf3wLBeKFc805tRxMHoUWmFF2z8PKLPQw2rZU1LQjZvVY+9/aarcL00qmr NfK3wiUR7dUua6PKJS2zSw+QXFHEJUTwL6gEiAXWnKAkMKEWlQipQv8GlujRvgRXpkyg ikwz/yEpVg2eEuNbssbEzqjECFqtqTTXgeUAVwVt494pXzSxYbBZNza4RhX2TaXfbkLT eFMwzxdOKMHJCNOKAlH7DZzwBkeyz2R6F8oMpIILfXIIZ4Q1UM7pwlUlVlbAhsHNzP4z 16oyZTyZdCwAlMZKXe/+S3mN+iDDzNpFnRTp9/3ybbRL49ytx2+s4tR6nQvn+y+UzlbT i8Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=wVoM3c/E0PalfRN1hpBEozujTlIGuGQofjRDPx3oYuQ=; b=CIOyu8bDLtzGPfBpzU5IsQBsMDROO4CBjgH5FgXuvIdNWYy930AS7o/C2Riiju3ykj LfulmzkcDGJXYtFxT2k1DijZR/1hed2BYsOxS2P2HsFXT6/z3IgTYXSpA+eKYk65h1up yEIQTQHTt3cGusWtE+Is9JbiNKwHRIzfmoCfSSCUwQtKUsvBuHbTmI64+J4rUtA1iO8b rR8xhaS+5JIAkyxt312v/c2gWMyUV4f6D06VU778LTtba/pelXpMpB184dZHy97dhQQ4 JHm94iKWxJw6+IjlskBTLJpsuAfM5/YG0EE7s61e58lw4NQbFOVPW4H9thaXVih3LiXZ TN1g== X-Gm-Message-State: AOUpUlED5o4NYcrrafnOu5EI6Zv+sUidAwTjgD48kX7IZ5IwhxqV2eZ5 htPuwoIZ2Q2IjHc97K6lfvpzSAft X-Google-Smtp-Source: AA+uWPzeSxV+Fc1WLvRuydmthKrvJj4uATnUrv0oYkyeEUIM2r9VAXUjbk5plXGcJ7XrrCaAIsbatg== X-Received: by 2002:a17:902:ab94:: with SMTP id f20-v6mr7073984plr.231.1533926669942; Fri, 10 Aug 2018 11:44:29 -0700 (PDT) Received: from raichu (toroon0560w-lp130-09-70-52-224-239.dsl.bell.ca. [70.52.224.239]) by smtp.gmail.com with ESMTPSA id x2-v6sm19458650pfi.166.2018.08.10.11.44.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Aug 2018 11:44:28 -0700 (PDT) Sender: Mark Johnston Date: Fri, 10 Aug 2018 14:44:26 -0400 From: Mark Johnston To: Bruce Evans Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r337426 - head/sbin/ifconfig Message-ID: <20180810184426.GB52302@raichu> References: <201808071725.w77HPciT051597@repo.freebsd.org> <20180810092251.K1276@besplex.bde.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180810092251.K1276@besplex.bde.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.27 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: Fri, 10 Aug 2018 18:44:31 -0000 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.