(Note: this EDITed version is a truncated part of the original OP (kept at the bottom), after this correct comment. Two separate questions 1 and 2 were also posted. All this improves SO.)
I am slowly migrating from Eclipse CDT to VSCode with C/C++ Extension Pack. I am working under Ubuntu 22, with g++.
When working in Eclipse, I am used to compiling/linking via g++ from within VSC, and getting a list of compilation errors.
Eclipse CDT has its own Code Analysis tool. This tool "knows quite a bit" about C++ (although "much less" than the compiler) and produces further errors and warnings, without compiling, that add to the list above. But it sometimes reports false positives, where there is nothing to fix (at least when compiling with g++).
To avoid these errors tainting the list, I can turn off CodeAn (I don't know if VSC lingo has a name for that). Note that this still allows for quick-navigating (error list) -> (code), it only removes error reporting by the Eclipse Code Analysis, keeping only actual compilation errors.
Below I am adding two images of the configuration menu in Eclipse. Scrolling down there are many other cases that can be detected by CodeAn.
Can I perform this with VSCode? Note that I am referring to VSCode. Disabling CodeAn for VS might be different.
Original question (likely to be removed shortly to reduce the clutter)
I have a large C++ package, with its own CMake files. Note that, when working at the command prompt, I use CMake to generate makefiles, and then compiling/linking with make <flags> <target>. I don't use cmake --build, e.g. When working in Eclipse, I am used to:
- Setting up make targets so I compile/link with a double click.
- Whenever a compilation error shows up, I can double click on the error in the list of errors to go straight to the line producing the error.
Eclipse CDT has its own Code Analysis tool. This tool "knows quite a bit" about C++ (although "much less" than the compiler) and produces a list of errors and warnings, without compiling. But it sometimes reports false positives, where there is nothing to fix (at least when compiling with g++).
- To avoid these errors tainting the list, I can turn off CodeAn. Note that this still allows for navigating the code, it only removes error reporting by the Eclipse Code Analysis. These are two images of the configuration menu in Eclipse. Scrolling down there are many other cases that can be detected by CodeAn.
[IMAGES]
Can I perform #2 with VSCode? I tried a few things for #1 (which is likely a prerequisite for #2), with json files, but I could not make it work. EDIT: This question was split into here. I will shortly adapt this OP.


filename:linein the build log, and it will take you to that file and line.