[cfe-dev] Error while trying to load a compilation database:

Kirill Bobyrev via cfe-dev cfe-dev at lists.llvm.org
Wed Feb 3 04:02:49 PST 2016


Hi,

Please, provide more datailed explanation of your issue. Which one of the
following is it?

a) You have a compilation database in place and clang-tidy does not detect
it.
b) You don't have a compilation database.

If it's b) you obviously can get rid of this error by getting a compilation
database (on how to refer to Running Clang Tidy on LLVM
<http://clang.llvm.org/extra/clang-tidy/#running-clang-tidy-on-llvm>).

Generally you might not always want to have a compilation database if your
goal is just to analyze a single source file: this error doesn't prevent
clang-tidy from inspecting the provided sourcefile, so you'll still get
your diagnostics even if no compilation database is up.

Hope this helps,
Kirill Bobyrev

On Wed, Feb 3, 2016 at 2:35 PM, phi clang via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi All,
>
> How do I get rid of this error ?
>
> CX08$ /home/phi/llvmbuild/bin/clang-tidy -fix-errors
> -checks='readability-braces-around-statements' c.c
> Error while trying to load a compilation database:
> Could not auto-detect compilation database for file "c.c"
> No compilation database found in /home/phi or any parent directory
> json-compilation-database: Error while opening JSON database: No such file
> or directory
>
> Thanx in advance
> Cheers,
> Phi
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160203/a934b950/attachment.html>


More information about the cfe-dev mailing list