On Fri, Jan 14, 2022 at 05:59:24PM +0100, Claudio Jeker wrote:
> On Fri, Jan 14, 2022 at 04:44:49PM +0000, Stuart Henderson wrote:
> > On 2022/01/14 16:52, Rafael Sadowski wrote:
> > > On Fri Jan 14, 2022 at 03:17:21PM +0100, Tobias Heider wrote:
> > > > Hi,
> > > > 
> > > > clang ships with a pretty useful static analyzer to find all kinds of 
> > > > bugs
> > > > in C and C++ code:
> > > > 
> > > > https://clang-analyzer.llvm.org/
> > > > 
> > > > I use it regularly to check my own diffs and found plenty of bugs I 
> > > > could
> > > > have missed otherwise.  While we have the code in base we don't actually
> > > > build it into our libclang currently, so the only ways to use it are
> > > > manually modifying the Makefiles or installing llvm from ports.
> > > > 
> > > > I was wondering if anyone else uses this and if there was any interest 
> > > > to
> > > > have this in our base clang?
> > > 
> > > Please checkout devel/clang-tools-extra, if you missed something let me 
> > > know.
> > > CLANG_ENABLE_STATIC_ANALYZER=ON is enabled by default.
> > 
> > No need for clang-tools-extra, it is in the llvm package
> > 
> > Like others I am happy just having the static analyzer / scan-build in
> > ports. It is useful, but I think not really useful enough to add to the
> > time taken by llvm in every base build when it's available in ports.
> 
> The build spends a lot of time in lldb and its usefulness is questionable.
> Why do not tell people to install lldb from ports as well?
> 
> Honestly the build time of clang is already so bad that adding an extra
> few 100 objects to it would not make it much worse.

I have compared build time without and with the static analyzer
patch.

root@ot29:.../clang# time make -j 6
   90m55.98s real   280m16.61s user   212m18.56s system
   98m56.58s real   302m43.42s user   227m02.29s system

This is 8 minutes or 8.8% more real build time for clang subdir.
Having the analyzer in base is good if people use it.  It is even
more useful if this encourages people to find and fix bugs.

But it is a waste of time if all potential bug fixers use the ports
version anyway.

I am a bit undecided, but prefer to ship it with base.

bluhm

Reply via email to