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

David Blaikie dblaikie at gmail.com
Wed Jul 24 19:14:16 PDT 2013


Please include the tests and product code change in the same patch (&
ideally attach the patch at least (including it inline in the email is
optional) or consider using Phabricator

For details:
http://llvm.org/docs/DeveloperPolicy.html
http://llvm.org/docs/Phabricator.html

On Wed, Jul 24, 2013 at 6:16 PM, Alex Wang <alexw at nicira.com> wrote:
> 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;
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev



More information about the cfe-dev mailing list