An error occurred while analyzing the following compilation unit

Template for a good bug report, formatted with Markdown:

  • versions used CFamily plugin version: 6.28.0.39490
  • error observed
An error occurred while analyzing the following compilation unit: 
  /home/azure-agent/agent/_work/3/s/my_src.c
A file named "sonar-cfamily-reproducer.zip" has been generated to help the problem investigation.
Please contact SonarSource support providing the following file to help improving the analyzer:
  /home/azure-agent/agent/_work/3/s/sonar-cfamily-reproducer.zip
ERROR: 
An error occurred while analyzing the following compilation unit: 
 /home/azure-agent/agent/_work/3/s/my_src.c
A file named "sonar-cfamily-reproducer.zip" has been generated to help the problem investigation.
Please contact SonarSource support providing the following file to help improving the analyzer:
  /home/azure-agent/agent/_work/3/s/sonar-cfamily-reproducer.zip



I updated to the latest scanner, the code compiles fine via make (albeit with a lot of warnings). I have the sonar-cfamily-reproducer.zip available if needed.

This code is just plain C.

Hi @Zachary_Brady ,

I sent you a PM.

Hi @Zachary_Brady ,

I created a ticket to fix the issue you are encountering: CPP-3426.

In the meantime, if you are stuck you could try temporarily excluding such file from the analysis.

Thank you @mpaladin, currently the target files are based on my make. Do you have a link to documentation on how to ignore a file?

Hi @Zachary_Brady ,

you can have a look at Narrowing the Focus documentation page. You can use sonar.exclusions property to set it to exclude that file.

1 Like

Thank you very much!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.