From mboxrd@z Thu Jan 1 00:00:00 1970 From: Josh Triplett Subject: Re: gcc tickets for sparse attributes Date: Fri, 17 Jan 2014 01:22:28 -0800 Message-ID: <20140117092223.GC577@leaf> References: <52D8BF2C.9090604@zytor.com> <1389947596.4354.2.camel@jlt4.sipsolutions.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from relay3-d.mail.gandi.net ([217.70.183.195]:54471 "EHLO relay3-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751958AbaAQJWg (ORCPT ); Fri, 17 Jan 2014 04:22:36 -0500 Content-Disposition: inline In-Reply-To: <1389947596.4354.2.camel@jlt4.sipsolutions.net> Sender: linux-sparse-owner@vger.kernel.org List-Id: linux-sparse@vger.kernel.org To: Johannes Berg Cc: "H. Peter Anvin" , Linux-Sparse , Linux Kernel Mailing List On Fri, Jan 17, 2014 at 09:33:16AM +0100, Johannes Berg wrote: > On Thu, 2014-01-16 at 21:27 -0800, H. Peter Anvin wrote: > > > However, I would also like support for the context extensions, but I'm > > not knowledgeable enough to describe the semantics accurately. Would > > anyone be willing to file a ticket describing how the context extension > > works well enough that it could be implemented? > > IMHO the context extension doesn't work well enough in sparse to > document and implement as is. It would be much better if it actually was > able to differentiate between contexts, rather than treating each one > the same. That would certainly be nice, but that's something actually much more easily done in GCC than in Sparse, given the types of information GCC already has available to implement features like alias analysis. In any case, the spec I wrote up assumes a distinction between contexts, but allows for an initial implementation like Sparse's that ignores the distinction. > This would avoid the problem that locking one lock and > unlocking another (in the kernel's __acquire/ __release mechanism) could > still result in a warning. That would actually *not* produce a warning, though it should. In general, I *think* an implementation like Sparse's that ignores the distinction between locks should produce false negatives but not false positives. - Josh Triplett