I am getting an error when I try to run SonarLint analysis in Eclipse for a C project. I have tried uninstalling, reinstalling and none of it works. Appreciate any help in fixing this. error log.txt (33.2 KB)
When I run an analysis manually:
Error during execution of SonarLint analysis
java.lang.UnsupportedOperationException: Unsupported value of STDC_VERSION macro: 201710L
at com.sonar.cpp.N.H.A(na:3497)
at com.sonar.cpp.N.A.A(na:1763)
at com.sonar.cpp.plugin.R.A(na:2887)
at com.sonar.cpp.plugin.R.execute(na:156)
at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:81)
When eclipse starts:
Setting filesystem encoding: UTF-8
Error during execution of SonarLint analysis
java.lang.NullPointerException
at com.sonar.cpp.N.H.B(na:1388)
at com.sonar.cpp.N.A.A(na:400)
at com.sonar.cpp.plugin.R.A(na:2887)
at com.sonar.cpp.plugin.R.execute(na:156)
at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.executeSensor(SensorsExecutor.java:81)
at org.sonarsource.sonarlint.core.analyzer.sensor.SensorsExecutor.execute(SensorsExecutor.java:72)
Hi @mpaladin , I set the compiler flag -std=c11 and still see the issue with the same error messages as my original post. Today SonarLint updated to 4.1 as well and still seeing the issue.
@sujeeth we can’t blindly guess how exactly you specified -std=c11, but definitely wrongly.
For example here is default configuration in a fresh installation of Eclipse IDE for C/C++ Developers version 2018-12 (4.10.0), which indeed fails with GCC 8:
java.lang.UnsupportedOperationException: Unsupported value of STDC_VERSION macro: 201710L
at com.sonar.cpp.N.H.A(na:3497)
at com.sonar.cpp.N.A.A(na:1763)
and your screenshot shows
java.lang.NullPointerException
at com.sonar.cpp.N.H.B(na:1388)
at com.sonar.cpp.N.A.A(na:400)
@Godin, sorry about the confusion. My original description mentions both the error messages. I have been receiving one or the other. And with c11 it is consistently the NullPointer
@mpaladin I noticed the dev ticket is now marked resolved. But I assume the release is still a long way out. Is there a temporary workaround I can do to get past this issue and have my code analysed?