[cfe-commits] r146174 - in /cfe/trunk: lib/Analysis/ThreadSafety.cpp lib/Sema/AnalysisBasedWarnings.cpp test/SemaCXX/warn-thread-safety-analysis.cpp

Chandler Carruth chandlerc at google.com
Thu Dec 8 13:32:34 PST 2011


On Thu, Dec 8, 2011 at 12:45 PM, Delesley Hutchins <delesley at google.com>wrote:

> I don't like the second warning, but it's not necessarily all that
> easy to get rid of it.  As with many warnings, once the compiler is
> confused, you may get several warnings due to one mistake.  It's hard
> to avoid that in all cases.
>

But that's not really the case here. The compiler isn't confused.

It seems like when you are warning about an invalid locking pattern, you
should mark the aspects of that pattern already warned about as invalid to
suppress subsequent warnings on them.

For example, when you see a lock acquired a second time, warn about it, but
then suppress both the acquisition and the subsequent (paired) release from
the lockset so that you don't get further warnings.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20111208/0bfb547f/attachment.html>


More information about the cfe-commits mailing list