recently we started to use SQ in our C project. However looks like SonarQube has issue with detecting bugs in the C code.
Therefore I have prepared simply, dedicated test file which contains bugs defined in SQ rules ( just copy-paste from SQ rules for C, and make it ‘compilable’ in the project).
After analysis none of them have been detected by SonarScanner .
Information about setup:
SQ Developer Edition, Version 7.7.0.23042
SonarCFamily plugin 6.3 9build 11371)
SonarQube Scanner 3.3.0.1492
We call wrapper in Jenkins like this:
D:\jenkins_slave\workspace\xxxx\build-wrapper-win-x86\build-wrapper-win-x86-64.exe --out-dir D:\jenkins_slave\workspace\xxxx\sq_out make all -j6
And later Scanner:
/var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQScanner/bin/sonar-scanner -Dsonar.projectKey=xxxx -Dsonar.cfamily.build-wrapper-output=sq_out -Dsonar.sources=APP/xxxx/Source/ASP
That is all in this file. Looks like something is missing.
By sonar-scanner output log you mean output from terminal? I could not find any log. Terminal output attached (please note that some private data has been removed) sonar-scaner_output.txt (5.9 KB)
I confirm that we currently don’t support Green Hills compilers, that explains why the build-wrapper-dump.json file is empty and you don’t get any file analyzed.
By default we use GH and it would be perfect to use it with SQ directly (in current toolchain).
Sure we can change compiler, however this is causing some additional effort and extend CI setup.
you might want to look into CodeSonar by GrammaTech who offers full support for the GHS compiler.
We’ve implemented CS recently for our embedded teams and will be running comparisons to understand if we’ll standardize on (CS) or maintain both (CS & SQ) going forward.