From owner-svn-src-head@FreeBSD.ORG Thu Nov 29 20:57:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id CB4AE8F9; Thu, 29 Nov 2012 20:57:38 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 2096D8FC0C; Thu, 29 Nov 2012 20:57:37 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qATKvTGk009937; Thu, 29 Nov 2012 22:57:29 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qATKvTGk009937 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qATKvTrt009936; Thu, 29 Nov 2012 22:57:29 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 29 Nov 2012 22:57:29 +0200 From: Konstantin Belousov To: Jilles Tjoelker Subject: Re: svn commit: r243665 - head/sbin/dump Message-ID: <20121129205729.GN3013@kib.kiev.ua> References: <201211290516.qAT5GoT5098709@svn.freebsd.org> <20121129120147.GE3013@kib.kiev.ua> <20121129162412.GD29338@stack.nl> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="s33OSBZCP+C8M/FY" Content-Disposition: inline In-Reply-To: <20121129162412.GD29338@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Eitan Adler X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 29 Nov 2012 20:57:38 -0000 --s33OSBZCP+C8M/FY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Nov 29, 2012 at 05:24:12PM +0100, Jilles Tjoelker wrote: > On Thu, Nov 29, 2012 at 02:01:47PM +0200, Konstantin Belousov wrote: > > On Thu, Nov 29, 2012 at 05:16:50AM +0000, Eitan Adler wrote: > > > Author: eadler > > > Date: Thu Nov 29 05:16:50 2012 > > > New Revision: 243665 > > > URL: http://svnweb.freebsd.org/changeset/base/243665 >=20 > > > Log: > > > Mark non-returning function as such >=20 > > > PR: bin/172978 > > > Approved by: cperciva > > > MFC after: 3 days >=20 > > > Modified: > > > head/sbin/dump/dump.h >=20 > > > Modified: head/sbin/dump/dump.h > > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > > --- head/sbin/dump/dump.h Thu Nov 29 03:48:39 2012 (r243664) > > > +++ head/sbin/dump/dump.h Thu Nov 29 05:16:50 2012 (r243665) > > > @@ -121,7 +121,7 @@ void trewind(void); > > > void writerec(char *dp, int isspcl); > > > =20 > > > void Exit(int status) __dead2; > > > -void dumpabort(int signo); > > > +void dumpabort(int signo) __dead2; > > > void dump_getfstab(void); > > > =20 > > > char *rawname(char *cp); >=20 > > What is the goal of this change ? >=20 > This has been discussed before in > http://lists.freebsd.org/pipermail/freebsd-current/2011-January/022179.ht= ml > and the rest of the thread. The result there seems that it is the least > bad thing to add __dead2 even on static functions that do not return to > reduce compiler/analyzer warnings and improve the generated code with > GCC 4.2.1 and GCC 4.5. But we are already in the shiny new world ? We should not care about so antique and unsupported compilers any more ? Or, at least, the commit message should have said that we do. I suppose that the worry about slightly unefficient code in the dump(8) wou= ld be good April 1 subject. >=20 > > It is arguably backward. There is absolutely no use to mark signal > > handler as __dead2, and all other uses do not benefit from the > > redundand declaration. >=20 > Although most of the uses of dumpabort() are in the same file as its > definition, GCC 4.2.1 is too dumb to detect its noreturn property > automatically. >=20 > Furthermore, some of the uses are in separate files. In particular, > __dead2 on dumpabort() is required to mark or detect quit() as noreturn. >=20 > > Also, being quite removed from the function definition, there is a > > chance that some future modification would make the attribute a lie. >=20 > Both GCC and Clang generate a warning by default if it appears possible > for a noreturn function to return, so as long as -Werror remains enabled > it should be safe enough. The annotation is very much like comment which rephrase the code and thus is useless. But in this case, the attribute annotation does has a chance of changing the compiler behaviour. IMO, such changes shall not be done, and the already accumulated nonsense needs to be reverted. --s33OSBZCP+C8M/FY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJQt8w4AAoJEJDCuSvBvK1B1gwQAJ0ILgnDl6p7NFlMZJX9Dsg0 Je71RR6hibh8InvO6QSfKkj+QFNIAmjFDAaFrw9YsK1cGCHmN87F8DUncdDyxm/p ZClOsiBErb6eAh6lBXLFpde0FHyEpVZgC0lw1e2+3WPoj3dd2mCIQuYvnC0Afg3d vbENP2A4n+5Ttra6SgwmCueayWxw24IQE1uE1u+JETxkdqpeyW6iP6cpYFN4ueuJ MNglJ9lDhRa6Q3aekAS6ktx6Na5Ac0QC0yRNnz1WWhF/1kecL8y3kOqe29Gqsepo Rmr6tLkv+FhASybLC3AB1HIY8nunihnZ/x7QFHuTzqc+7B93bCWWBeOBNDulniVL ERx/k+x2SjzJyeZHR1Y6jZd63+aH5KfKGVZNSfRdWzueTdLsP9OW02emy06PoG7O 32pPmsy945/bTdLHqAh3caTW/QJ5IIdj1RVJ7TGqXYyhsOxik3LbDMzEDCQLPT6g vOqSXtyxGAGZpJXk1VLbMr0WYGtN/gPX7FIIviX6i7RgH8qcLH943ILZ5j4fR43+ bO2JWVTYJvUndkxwDmnXaqiltB8SfLH77K+yxejcCIQzmer4A8U6PwLe/SUOJj5q bcgbAa1UcnRFLs8h7eYh6gIo8WtIDLy0LcTu4OfJ/E/8c/R4GfifNKkBRiu0uyRN cHmu3THybrHfyZd8OUS4 =05Qe -----END PGP SIGNATURE----- --s33OSBZCP+C8M/FY--