From owner-freebsd-current@FreeBSD.ORG Tue Jan 11 10:33:25 2011 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 531B61065670; Tue, 11 Jan 2011 10:33:25 +0000 (UTC) (envelope-from uqs@spoerlein.net) Received: from acme.spoerlein.net (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by mx1.freebsd.org (Postfix) with ESMTP id D32C98FC1E; Tue, 11 Jan 2011 10:33:24 +0000 (UTC) Received: from localhost (acme.spoerlein.net [IPv6:2a01:4f8:131:23c2::1]) by acme.spoerlein.net (8.14.4/8.14.4) with ESMTP id p0BAXMV2038745 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 11 Jan 2011 11:33:22 +0100 (CET) (envelope-from uqs@spoerlein.net) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=spoerlein.net; s=dkim200908; t=1294742002; bh=S2T3OeXjpCpD9c0LeR0SZ+pITW5bkTslobAbP8MsRs8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Transfer-Encoding:In-Reply-To; b=p0ywL5ZypksaMFYC2frnow5fAoU1xxS2pkkcgKGfrEJW2u7okR+BhMvTDfVdKXviH hjIQqOApXjaxwka+K1pUlHq9UN1lsDG8rQwgeIVGJJFt/GcuqhqSkrpYLYjAn7RzK9 i1DVBTFeWGPr/R6F4inmyeGIObBqQwBjII+w6Y6U= Date: Tue, 11 Jan 2011 11:33:22 +0100 From: Ulrich =?utf-8?B?U3DDtnJsZWlu?= To: Jilles Tjoelker Message-ID: <20110111103322.GM23329@acme.spoerlein.net> Mail-Followup-To: Jilles Tjoelker , John Baldwin , freebsd-current@freebsd.org, Erik Cederstrand References: <20110105131439.GN23329@acme.spoerlein.net> <4184C8F2-3C6D-46FB-8F10-DDEBA6DB1C35@cederstrand.dk> <201101050934.49845.jhb@freebsd.org> <20110105165545.GP23329@acme.spoerlein.net> <20110105193653.GA49285@stack.nl> <20110105213043.GT23329@acme.spoerlein.net> <20110109001353.GA85498@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20110109001353.GA85498@stack.nl> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: freebsd-current@freebsd.org, Erik Cederstrand Subject: Re: FYI: clang static analyzer page has moved to http://scan.freebsd.your.org/freebsd-head/ X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 11 Jan 2011 10:33:25 -0000 On Sun, 09.01.2011 at 01:13:54 +0100, Jilles Tjoelker wrote: > On Wed, Jan 05, 2011 at 10:30:43PM +0100, Ulrich Spörlein wrote: > > On Wed, 05.01.2011 at 20:36:53 +0100, Jilles Tjoelker wrote: > > > On Wed, Jan 05, 2011 at 05:55:45PM +0100, Ulrich Spörlein wrote: > > > > *But*, it should grok that for err(3) and exit(3). Now there are some > > > > possible remedies: > > > > > - get IPA to work with clang, or at least file a bug > > > > > - mark functions as __dead2 (please don't do that) > > > > Why not? > > > Cause IMHO it adds clutter, is noisy and needs to be maintained > > manually, when we have these "computer" things that should deduct this > > by themselves. > > Yes, but to me it seems the only realistic option of your three. > Upstream is unlikely to add IPA to the checker and other kinds of > annotation are probably either similar to __dead2 with the same problems > and an additional one that gcc does not check it or very specific to a > particular complaint from the checker. > > > > I have done this in some cases because it leads to better code with gcc > > > (the system version in 9-current). See SVN commit r212508 to > > > bin/sh/parser.c. Although synexpect() and synerror() are static, adding > > > __dead2 to both makes the executable 576 bytes smaller on i386 (these > > > functions are called many times). Adding __dead2 to synexpect() only > > > causes a warning "noreturn function does return" (it calls synerror()). > > > Adding __dead2 to synerror() only also makes the executable smaller but > > > not as much as adding it to both. > > > > Reordering the functions in the file does not help to make gcc see that > > > the functions do not return. > > > This is too bad and really makes me sad. It shouldn't be necessary to > > hand-hold the compilers like that. Could you try some tests with gcc 4.5 > > to confirm this is still required? > > gcc 4.5 still needs it. gcc 4.6 and clang (the compiler) do not need it. > (For gcc, used ports gcc and compiled head bin/sh with some patches on > stable/8. For clang, used base clang and compiled head bin/sh on head.) Thank you for confirming this, this is good to know. Looks like I need to stop worrying and learn to love the __dead2! :D Uli