r244312 - Silence tools/clang/lib/Tooling/CompilationDatabase.cpp:328:12: warning:

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 7 09:02:39 PDT 2015


On Fri, Aug 7, 2015 at 3:15 AM, Yaron Keren via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Author: yrnkrn
> Date: Fri Aug  7 05:15:15 2015
> New Revision: 244312
>
> URL: http://llvm.org/viewvc/llvm-project?rev=244312&view=rev
> Log:
> Silence tools/clang/lib/Tooling/CompilationDatabase.cpp:328:12: warning:
> ‘clang::tooling::JSONAnchorDest’ defined but not used [-Wunused-variable]
> from gcc 5.1.
>
>
> Modified:
>     cfe/trunk/lib/Tooling/CompilationDatabase.cpp
>
> Modified: cfe/trunk/lib/Tooling/CompilationDatabase.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Tooling/CompilationDatabase.cpp?rev=244312&r1=244311&r2=244312&view=diff
>
> ==============================================================================
> --- cfe/trunk/lib/Tooling/CompilationDatabase.cpp (original)
> +++ cfe/trunk/lib/Tooling/CompilationDatabase.cpp Fri Aug  7 05:15:15 2015
> @@ -325,7 +325,7 @@ namespace tooling {
>  // This anchor is used to force the linker to link in the generated
> object file
>  // and thus register the JSONCompilationDatabasePlugin.
>  extern volatile int JSONAnchorSource;
> -static int JSONAnchorDest = JSONAnchorSource;
>

Perhaps this just needs __attribute__((used)) or __attribute__((unused))
(probably the latter) - I imagine we have macros for those?


> +int JSONAnchorDest = JSONAnchorSource;
>
>  } // end namespace tooling
>  } // end namespace clang
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150807/cbddad05/attachment.html>


More information about the cfe-commits mailing list