Hello,

I did run some static analysis tools over xenomai 3.1rc2 userspace libraries,
and there seems to be alot of real issues.

The tools are clangs builtin statical analysis and clang-tidy, naturally there
is some overlap in the reports.
clang-tidy would need to be configured to fit Xenomai's practices
(there is a ton of configurable checks), so this is more of an example.
The other, clang's statical analysis is more relevant as there are very few
false positives.

Additionally to the checks, there is a directory failures, files that cant
be built with clang. Even if no one ships Xenomai built by that compiler,
fixing those should help, for being able to run those tools and several IDE's
and Editors already use clangd for code competition etc.

I'd hope that such reports could be incorporated into the CI builds.
running the analysis on cross-builds is alot more daunting,
but on native builds its rather easy.

regards, Norbert

# on my debian "testing" system clang is at 9.0
apt-get install clang-9 clang-tidy-9 bear

../xenomai-v3.1-rc2/configure --enable-smp --enable-registry --with-core=cobalt

# build every file with with gcc and clang, report is stored in a folder in /tmp
scan-build-9 make -j9


# generate a compile_commands.json database
make clean
bear make -j9

# run clang-tidy on files in the database
run-clang-tidy-9 > tidy-report.txt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tidy-cobalt.tar.xz
Type: application/x-xz
Size: 37172 bytes
Desc: not available
URL: 
<http://xenomai.org/pipermail/xenomai/attachments/20191013/bd445d72/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tidy-mercury.tar.xz
Type: application/x-xz
Size: 18244 bytes
Desc: not available
URL: 
<http://xenomai.org/pipermail/xenomai/attachments/20191013/bd445d72/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scan-build-mercury.tar.xz
Type: application/x-xz
Size: 238392 bytes
Desc: not available
URL: 
<http://xenomai.org/pipermail/xenomai/attachments/20191013/bd445d72/attachment-0002.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scan-build-cobalt.tar.xz
Type: application/x-xz
Size: 396308 bytes
Desc: not available
URL: 
<http://xenomai.org/pipermail/xenomai/attachments/20191013/bd445d72/attachment-0003.bin>

Reply via email to