[cfe-dev] Is it possible to get static analyzer fixits via libclang?

Artem Dergachev via cfe-dev cfe-dev at lists.llvm.org
Wed May 24 23:33:28 PDT 2017


Static analyzer doesn't currently produce fixits, because classes of 
bugs it finds ("path-sensitive" bug reports that take a lot of different 
source code locations into account, such as memory leak paths or null 
dereference paths) are quite different in nature from normal warnings 
issued by the compiler or lint tools like clang-tidy, and most of them 
are very hard to reasonably fix automatically.


The analyzer also doesn't work when the translation unit has errors, 
which seems to be your case (missing semicolon?).


I'd also hint that using the scan-build tool instead of adding --analyze 
manually is usually easier for bigger projects.



On 5/24/17 11:37 PM, Dan Walmsley via cfe-dev wrote:
>
> Hi,
>
>
>    Is it possible to get the fixits that clang-tidy can produce, but 
> via libclang?
>
>
> I tried adding the --analyze option when creating the translation 
> unit, but I don't see any static analyser warnings and only fixit I 
> have seen so far is to add missing semi colon.
>
>
> Thanks in advance
>
>
> Dan
>
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list