From owner-svn-src-all@FreeBSD.ORG Wed Jan 16 18:11:54 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A3124734; Wed, 16 Jan 2013 18:11:54 +0000 (UTC) (envelope-from delphij@delphij.net) Received: from anubis.delphij.net (anubis.delphij.net [64.62.153.212]) by mx1.freebsd.org (Postfix) with ESMTP id 37710F68; Wed, 16 Jan 2013 18:11:54 +0000 (UTC) Received: from epsilon.delphij.net (drawbridge.ixsystems.com [206.40.55.65]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by anubis.delphij.net (Postfix) with ESMTPSA id 40B0612987; Wed, 16 Jan 2013 10:11:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=delphij.net; s=anubis; t=1358359913; bh=sv6PTpPTMAoIoIqmImR+T76eGxU/hiAGaY/8mf8COhc=; h=Date:From:Reply-To:To:CC:Subject:References:In-Reply-To; b=cJRIAqEzfhuXB4OOQog/aH7rfQ1L+SPQhMqCMaoMA1US8bdZkyAKl0MJNCTwNx0mP od2IRPKN5c3Jox1ty1iu6ib4H1VCBWvhrNyg4hWPKHDbCv19ZySKLtfZX6GTJvyP+I vTBmXD/rPwaaBwAUpcqJYCCZ6OOaKWOOSDdqCVBQ= Message-ID: <50F6ED68.50602@delphij.net> Date: Wed, 16 Jan 2013 10:11:52 -0800 From: Xin Li Organization: The FreeBSD Project MIME-Version: 1.0 To: Eitan Adler Subject: Re: svn commit: r245494 - head/bin/pwait References: <201301160503.r0G53qie087155@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.4.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Xin LI X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: d@delphij.net 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: Wed, 16 Jan 2013 18:11:54 -0000 -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512 On 01/16/13 09:47, Eitan Adler wrote: > On 16 January 2013 01:49, Xin LI wrote: >> This doesn't seem right -- you should never release memory before >> exit, especially for memory allocated in main(), unless this >> "main" is intended for different purpose like a monolithic shell >> that wants to avoid exec(). Note that pwait(1) have multiple exit >> points I don't think it's practical. > > ... > > There have been multiple conversations about this: on hackers, on > the commit lists, and on the clang analyzer lists. > > I don't care much how the final code looks: with either free or > return but please make sure that scan-build finds no warnings. Yes I did. Using exit(3) tells clang that this is the final exit and thus eliminates the warning. It sounds like a bug (or arguably a feature) that clang does not recognize return in main()s... Cheers, - -- Xin LI https://www.delphij.net/ FreeBSD - The Power to Serve! Live free or die -----BEGIN PGP SIGNATURE----- iQEcBAEBCgAGBQJQ9u1oAAoJEG80Jeu8UPuzNF8IAIuLlVRawKYSgvW0Qqf01Pt3 l6UvBc/6U0LBVTgRUVNVDqlvjyP93pcnMpDGiGqGf/1TbizWhahIayB7NxPQoiqE 8iFRYxhMXJL+pMgckgB3twGOrXkSCCaWhudmNlx9pPXac2dqCFF4PXugVAV1xVVx JfdkCHhSMH+MVhzxkPN4XtZTvH288UiaeWRsCLEzVwylYOvMqslW0WhJYRCpn6ee XXeBBN8D/aYOPehHZ7/UhzatxIUOQMaW509rituOZ6IKF5PAHhPQsXwIRiG85mIb tbppR2Pwm0wg/mOFcr44P/zhdeiR4+JW1Tk65mmleoLsq8aufzT/OjJnVcD6860= =nsUL -----END PGP SIGNATURE-----