-
Notifications
You must be signed in to change notification settings - Fork 440
Labels
analyzer 📈Related to the analyze commands (analysis driver)Related to the analyze commands (analysis driver)
Description
Describe the bug
On a project with 2 files with names, such that one file's name is a prefix to the other file's name (e.g, simple.c and simple.cc), CodeChecker analyze --file=simple.c will analyze simple.cc too, not just simple.c
CodeChecker version
6.26.1
To Reproduce
- Run the following script:
mkdir test_file_tag
cd test_file_tag
echo "int foo() { return 0/0; }" > simple.c
echo "int bar() { return 0/0; }" > simple.cc
echo "cmake_minimum_required(VERSION 3.10)" > CMakeLists.txt
echo "project(SimpleProject C CXX)" >> CMakeLists.txt
echo "add_executable(simple_app simple.c simple.cc)" >> CMakeLists.txt
mkdir build
cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
cd ..
CodeChecker analyze --analyzers clangsa clang-tidy --output=data --file=simple.c build/compile_commands.json- See that CodeChecker analyzed both
simple.candsimple.cc
[INFO 2025-09-22 09:21] - Starting static analysis ...
[INFO 2025-09-22 09:21] - [1/4] clangsa analyzed simple.cc successfully.
[INFO 2025-09-22 09:21] - [1/4] clangsa analyzed simple.c successfully.
[INFO 2025-09-22 09:21] - [2/4] clang-tidy analyzed simple.cc successfully.
[INFO 2025-09-22 09:21] - [3/4] clang-tidy analyzed simple.c successfully.Expected behaviour
I expected that only simple.c would be analyzed
**Desktop
- OS: Linux - Ubuntu (ELX) 24.04
- Browser: Firefox (143.0)
Metadata
Metadata
Assignees
Labels
analyzer 📈Related to the analyze commands (analysis driver)Related to the analyze commands (analysis driver)