Alexander Bluhm wrote in
<[email protected]>:
|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:
|>>>> 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?
Fwiw, i have been astonished by this thread. I found scan-build
to generate a lot of false warnings, so much indeed that i stopped
using it .. in summer 2017.
So i tried again and except for a lot of "dead assignments",
which, well, are dead assignments but then again it is my style of
coding since on x86 there is a return register and so i am used to
write it like this, just in case, you know, and then "self" aka
*this is ready to go, there were mostly false warnings.
Coverity.com on the other hand always surprises me over and over
again with what it finds, .. and i do not even get paid for that.
'Only sayin' because clang here is sheer unbelievable almost 800MB
installed, and i wonder what for, even if (!) compared to gcc.
I do not use clang-format (though this might be an error of mine).
But mind you, i do not instrument my code for lint and successors
(except FALLTHRU, and that luckily now that compilers start
screaming for such cases, heck i am not autopilot driving). Now
that i am on github (again, mostly to ease people's burden with my
bug reports) i think i will not even download the newest Coverity
software but start using github's coverity hook.
You know, i struggle here because of
mv clang-tools-extra-$version.src clang-$version.src/tools/extra
cmake -S $name-$version.src -B build -G Ninja \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_INSTALL_LIBEXECDIR=lib/clang \
-D CMAKE_BUILD_TYPE=Release \
-D CMAKE_C_FLAGS_RELEASE="$CFLAGS" \
-D CMAKE_CXX_FLAGS_RELEASE="$CXXFLAGS" \
-D LLVM_EXTERNAL_LIT=/usr/bin/lit \
-D LLVM_PARALLEL_COMPILE_JOBS="${JOBS:-1}" \
-Wno-dev
cmake --build build
That is, i have to have it all or put more effort in maintaining
my system. I hate it. :)
--steffen
|
|Der Kragenbaer, The moon bear,
|der holt sich munter he cheerfully and one by one
|einen nach dem anderen runter wa.ks himself off
|(By Robert Gernhardt)