[cfe-dev] [PATCH 1/2] Thread-safety: Enable -Wthread-safety check for c.

Alex Wang alexw at nicira.com
Wed Jul 24 18:16:40 PDT 2013


Before this commit, the -Wthread-safety check is only for C++ code.
This commit makes it available for C code as well.

Co-authored-by: Ethan Jackson <ethan at nicira.com>
Signed-off-by: Alex Wang <alexw at nicira.com>

Index: SemaDeclAttr.cpp
===================================================================
--- SemaDeclAttr.cpp	(revision 186655)
+++ SemaDeclAttr.cpp	(working copy)
@@ -586,7 +586,7 @@
     return false;
 
   // FIXME: Lockable structs for C code.
-  if (!isa<CXXRecordDecl>(D)) {
+  if (!isa<RecordDecl>(D)) {
     S.Diag(Attr.getLoc(), diag::warn_thread_attribute_wrong_decl_type)
       << Attr.getName() << ThreadExpectedClassOrStruct;
     return false;



More information about the cfe-dev mailing list