what are you trying to achieve: I tried to analyze C language files with sonar-scanner
what have you tried so far to achieve this: The compiler (ccblkfn.exe from Analog Devices) used in my project is not officially supported by SonarQube. So as recommended, I manually created a compile_commands.json file with detailed compilation information. I saved this file together with a sonar-project.properties file in the root directory of my project and executed “sonar-scanner.bat -Dsonar.login=Mycredential” command. After a while of execution, I got the following results:
16:25:04.641 ERROR: Error during SonarScanner execution
java.lang.IllegalStateException: The Compilation Database JSON file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:
* you are correctly invoking the scanner with correct configuration
* your compiler is supported
* you are providing the path to the correct Compilation Database JSON
* you are building and analyzing the same source checkout, absolute paths must be identical in build and analysis steps
at com.sonar.cpp.plugin.CFamilySensor.process(CFamilySensor.java:494)
at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:215)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
I don’t know how to debug this problem. According to my understanding, compilation database is the method for C compilers which are not supported by sonar-build-wrapper. Does the error message mean that this compilation database method is not possible?
Could you please kindly help? Thanks in advance. Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!
The compiler you are using is currently not supported, this is the related ticket: [CPP-3477] - Jira. Even by using the compilation database, you won’t be able to analyze your project. Would you be able to build your project with one of the supported compilers?
Hello @jiaoli
Let me chime in here.
The page you mention is to collect interest (“under consideration” tab).
At this stage, there is no decision taken about implementing support for CCES.
That being said, we take note of your interest.
If you didn’t see – last year we introduced support in SonarQube Server for a feature called C/C++ AutoConfig! Removing the question of supported compiler altogether.
This is available in SonarQube Server v10.6+, although you should really target at least v2025.1.