Bugs detection issue with C language


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
  • SonarCFamily plugin 6.3 9build 11371)
  • SonarQube Scanner

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

INFO: Scanner configuration file: /var/jenkins_home/tools/hudson.plugins.sonar.SonarRunnerInstallation/SonarQScanner/conf/sonar-scanner.properties

As results we get:
Analysis total time: 9.484 s

Note that code Smells and Duplications are detected in the project.

Are we missing something?

Hi @tomasz_s,

could you please share sq_out/build-wrapper-dump.json file and the sonar-scanner output log?

Hi @mpaladin,
thanks for replay. Sure, here it is build-wrapper-dump.json
# © SonarSource SA, 2014-2019, info@sonarsource.com
# All SONARSOURCE programs and content are copyright protected.
# SONARSOURCE and SONARQUBE are trademarks of SonarSource SA. All rights are expressly reserved.
# This file is designed exclusively for use with the SONARSOURCE C / C++ / Objective-C Plugin.
# It may not be used in connection with any other software.
# Any other use is prohibited by law and may be grounds for immediate termination of your License.

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)

Hi @tomasz_s,

build-wrapper-dump.json is empty, it means that build-wrapper didn’t capture your compiler invocation. What compiler are you using?

@mpaladin we are using Green Hills compiler

I know that it is not in the list of supported compilers, however build wrapper does not report any issues.

Could that be the reason?

Hi @tomasz_s,

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.

@mpaladin Thank you. This answer my question.

Do you have any plans to provide support for this compiler in the future?

Hi @tomasz_s,

we do have plans to expand our compilers support offering but I cannot provide you with any ETA. Is your code compilable only with Green Hills?

@mpaladin Thank you again for quick support here.

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.

Hi @tomasz_s,

thank you for your request and feedback.

we stumbled over the same problem. our teams using the greenhills compiler for embedded projects.
I still guess there are no ETAs ATM, right? :smiley:

Hi @tomasz_s and @c.staffa,

I created a ticket to track Green Hills compilers support CPP-2239, feel free to watch it.