SonarQube and C code - error during running sonar-scanner command

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)

  • Developer Edition

  • Version 8.1 (build 31237)

  • what are you trying to achieve

Run sonar-scanner command with C code.

  • what have you tried so far to achieve this
    Result is below:

The compiler probe ‘stdout’ is expected to contain at least one ‘#define’ directive:
14:12:13.202 INFO: 0 compilation units analyzed
14:12:13.293 INFO: ------------------------------------------------------------------------
14:12:13.294 INFO: EXECUTION FAILURE
14:12:13.295 INFO: ------------------------------------------------------------------------
14:12:13.297 INFO: Total time: 12.046s
14:12:13.360 INFO: Final Memory: 24M/100M
14:12:13.361 INFO: ------------------------------------------------------------------------
14:12:13.361 ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: The “build-wrapper-dump.json” file was found but 0 C/C++/Objective-C files were analyzed. Please make sure that:

  • you are using the latest version of the build-wrapper and the SonarCFamily analyzer
  • you are correctly invoking the scanner with correct configuration * your compiler is supported
  • you are wrapping your build correctly
  • you are wrapping a full/clean build
  • you are providing the path to the correct build-wrapper output directory
    at com.sonar.cpp.plugin.CFamilySensor.execute(CFamilySensor.java:255)
    at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:48)

New to this, any help is appreciated.

Hi @AirK,

what compiler are you using?

Hi @mpaladin,
Thank you very much for your reply. This is WindRiver, Diab C-Compiler.

Hi @AirK,

is it WindRiver dcc compiler? If yes it is not supported yet, see this ticket. We only support WindRiver gcc compiler.
https://jira.sonarsource.com/browse/CPP-2314

Hi @mpaladin,
Thanks so much for the prompt reply. This is the WindRiver Diab compiler. CC=@$(DIABLIB)\WIN32\bin\dcc.exe
Hmmm… Kind of disappointed. When do you think it will support this dcc?

Another notes,
I am doing an evaluation of the product. We also have embedded C projects built with IAR workbench environment. It is an ARM architecture.

image

Does SonorQube support this?
Thanks

Hi @AirK,

I don’t know and cannot make any promise unfortunately.

We do support IAR ARM, from IAR we support:

IAR compiler for ARM, Renesas RL78, Renesas RX, Renesas V850, Texas Instruments MSP430 and for 8051

For the full list of supported compilers: https://redirect.sonarsource.com/plugins/cpp.html

Hi @mpaladin
Thank you so much for the reply.
Can you please point me out to where examples of running SonarQube on IAR ARM?
Much appreciate!

Hi @AirK,

you can simply follow the normal documentation for C/C++.

A post was split to a new topic: Renesas ccrx compiler

A post was merged into an existing topic: SonarQube execution Error for c++ code using build-wrapper