I tried check the whole Linux kernel project with cppcheck, but I got a segmentation fault.
Steps:
1. Build the kernel (I built it for x86_64 with gcc (Ubuntu 13.2.0-4ubuntu3) 13.2.0 ).
2. Generate compile_commands.json with the script scripts/clang/gen_compile_commands.py.
3. Run cppcheck with the following options: cppcheck --clang=clang --project=compile_commands.json --enable=all > err.txt 2>&1
where clang --version returns 16.0.6
The process started and the last line in err.txt is the following:
5/2898 files checked 0% done
Checking arch/x86/boot/compressed/cpuflags.c...
Then the segmentation fault happened.
Before I start analyzing core dumps, I would like to know if my setup is just wrong. If so, I would like to know if someone runs cppcheck on the Linux kernel and how. I am fine with any other setup that works.
Last edit: Javier Carrasco 2024-05-05
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I tried check the whole Linux kernel project with cppcheck, but I got a segmentation fault.
Steps:
1. Build the kernel (I built it for x86_64 with gcc (Ubuntu 13.2.0-4ubuntu3) 13.2.0 ).
2. Generate compile_commands.json with the script scripts/clang/gen_compile_commands.py.
3. Run cppcheck with the following options: cppcheck --clang=clang --project=compile_commands.json --enable=all > err.txt 2>&1
where clang --version returns 16.0.6
The process started and the last line in err.txt is the following:
5/2898 files checked 0% done
Checking arch/x86/boot/compressed/cpuflags.c...
Then the segmentation fault happened.
Before I start analyzing core dumps, I would like to know if my setup is just wrong. If so, I would like to know if someone runs cppcheck on the Linux kernel and how. I am fine with any other setup that works.
Last edit: Javier Carrasco 2024-05-05
No matter the setup it should not crash.