No Sonarlint analysis performed in CLion

Versions used

  • CLion 2021.3.3
  • sonarlint-intellij-6.5.1.43866.zip
  • OS Windows 10 Enterprise 20H2

Error observed

No SonarLint Analysis is performed.

Steps to reproduce

Request a Sonarlint analysis via contextual menu on main.cpp file.

Potential workaround

None.

Attachments

main.cpp source code

(Containing forced errors in source code)

#include <iostream>

size_t get_size(std::string& s) {
	return s.size();
}

const int get_const_return_value() {
	int i = 5;
	return i;
}

int main() {

	std::cout << "Hello, World!" << std::endl;

	std::string myString = "Pierpaolo";
	size_t s = get_size(myString);

	std::cout << "String size is: " << s << std::endl;
	return 0;
}

Analysis verbose log

Start analysis
Index files
Language of file 'file:///C:/_disco%20D/JetBrains/CLionProjects/Untitled/main.cpp' is set to 'C++'

1 file indexed
Execute Sensor: Sonar Secrets Detection Sensor
Execute Sensor: CFamily

Probing compiler: [C:\_disco D\JetBrains\CLion\bin\mingw\bin\g++.exe, -x, c++, --std, gnu++14, -v, -dM, -E, -]

stdout:


stderr:

Using built-in specs.

COLLECT_GCC=C:\_disco D\JetBrains\CLion\bin\mingw\bin\g++.exe

Target: x86_64-w64-mingw32

Configured with: ../gcc-11.2.0/configure --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --build=x86_64-alpine-linux-musl --prefix=/win --enable-checking=release --enable-fully-dynamic-string --enable-languages=c,c++ --enable-libatomic --enable-libgomp --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --enable-seh-exceptions --enable-shared --enable-static --enable-threads=posix --enable-version-specific-runtime-libs --disable-bootstrap --disable-graphite --disable-libada --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-libquadmath --disable-lto --disable-nls --disable-multilib --disable-rpath --disable-symvers --disable-werror --disable-win32-registry --with-gnu-as --with-gnu-ld --with-system-libiconv --with-system-libz --with-gmp=/win/makedepends --with-mpfr=/win/makedepends --with-mpc=/win/makedepends

Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 11.2.0 (GCC)

COLLECT_GCC_OPTIONS='-std=gnu++14' '-v' '-dM' '-E' '-shared-libgcc' '-mtune=generic' '-march=x86-64'

C:/_disco D/JetBrains/CLion/bin/mingw/bin/../libexec/gcc/x86_64-w64-mingw32/11.2.0/cc1plus.exe -E -quiet -v -iprefix C:/_disco D/JetBrains/CLion/bin/mingw/bin/../lib/gcc/x86_64-w64-mingw32/11.2.0/ -D_REENTRANT - -mtune=generic -march=x86-64 -std=gnu++14 -dM -dumpbase -

Skip analysis of file: C:/_disco D/JetBrains/CLionProjects/Untitled/main.cpp
Subprocess(es) done in 619ms
0 compilation units analyzed
Done in 937ms

Processed 0 issues
Found 0 issues

Hi @prosin ,

you are facing what is described in [CPP-3144] MinGW GCC compiler probing should not lead to empty stdout - SonarSource. We applied a fix when the MinGW install is in a folder called mingw32 or mingw64. Could you try to either:

  • rename C:\_disco D\JetBrains\CLion\bin\mingw to C:\_disco D\JetBrains\CLion\bin\mingw32 or C:\_disco D\JetBrains\CLion\bin\mingw64
  • add C:\_disco D\JetBrains\CLion\bin\mingw\bin to your system path and make sure CLion picks the new PATH

Hi, this resolved my issue, thank a lot!

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