From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Triplett Subject: Re: [efi:next 2/3] arch/x86/boot/compressed/eboot.c:26:16: sparse: incorrect type in return expression (different modifiers) Date: Sun, 16 Nov 2014 10:22:05 -0800 Message-ID: <20141116182205.GB5032@thin> References: <201411120724.PdeIjimc%fengguang.wu@intel.com> <1415799312.14686.332.camel@mfleming-mobl1.ger.corp.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from relay4-d.mail.gandi.net ([217.70.183.196]:36398 "EHLO relay4-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755372AbaKPSWN (ORCPT ); Sun, 16 Nov 2014 13:22:13 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Christopher Li Cc: Ard Biesheuvel , Matt Fleming , "linux-efi@vger.kernel.org" , Linux-Sparse , "fengguang.wu" On Sun, Nov 16, 2014 at 06:13:28PM +0800, Christopher Li wrote: > On Wed, Nov 12, 2014 at 11:34 PM, Ard Biesheuvel > wrote: > > > > Well, I spent some time playing around with this: > > > > This one is accepted: > > > > static __attribute__((__pure__)) int pure1(void) > > { > > int i = 0; > > return i; > > } > > > > This one is not accepted: > > > > static __attribute__((__pure__)) void *pure2(void) > > { > > void *i = (void *)0; > > return i; > > } > > > > Thanks for the test case. I have commit your test case with a bit more > test case regarding function pointer assign. > > The change is in chrisl repository reveiw-pure-attr branch: > https://git.kernel.org/cgit/devel/sparse/chrisl/sparse.git/log/?h=review-pure-attr > > I purpose this fix for it. It can pass your test case. > This patch limit the pure attribute to functions. Wait, is the above being parsed as applying the pure attribute to the return value rather than to the function? Or is that not the issue here? - Josh Triplett