go2sh / cmake-integration-vscode

CMake Server Interface for VSCode.
https://go2sh.github.io/cmake-integration-vscode/
Other
19 stars 11 forks source link

GCC problem matcher does not recognize fatal errors #47

Closed moether closed 4 years ago

moether commented 4 years ago

If we include a header file which itself also includes another header file which does not exist, gcc will return a fatal error which is not detected by the gcc problem matcher, hence no problem is shown in the tab.

[1/2] Building CXX object CMakeFiles/test.dir/main.cpp.o
FAILED: CMakeFiles/test.dir/main.cpp.o 
/usr/bin/c++    -g -MD -MT CMakeFiles/test.dir/main.cpp.o -MF CMakeFiles/test.dir/main.cpp.o.d -o CMakeFiles/test.dir/main.cpp.o -c ../main.cpp
In file included from ../main.cpp:1:
../test.h:2:10: fatal error: nonexisting.h: No such file or directory
    2 | #include "nonexisting.h"
      |          ^~~~~~~~~~~~~~~
compilation terminated.
ninja: build stopped: subcommand failed.

Simple code to reproduce:

#include "test.h"

int main() {
  return 0;
}

content of test.h:

#include "nonexisting.h"