Parsing GCC build error ouptut? for a Makefile -> compiledb project
I am currently trying to use CLion for development for a large-ish code base for an embedded C project.
The embedded part is not relevant, other than the SDK uses an elaborate makefile system, and packages its own specific version of Make and the compilers (where the Makefiles have relative path references to the tools).
The part I am stuck on at the moment is getting parsing of the errors reported in the build system output.
Oddly, semantic errors that are detected in the code body do get red-squiggle underlines; I guess some other linting or language server tool is doing the parsing and picking those errors up before build even runs? But there also appears to be no "Problems" or "Errors" view, like in VSCode or other IDEs where I can see the detected errors listed.
So far, I have the steps descirbes here working:
https://www.jetbrains.com/help/clion/managing-makefile-projects.html
An example build output is something like:
apps/myapp.c: In function 'start':
apps/myapp.c:137:5: error: expected ';' before '{' token
{
^
Is there a way to set up the Output Filter to pick up these errors?
In VSCode, there is a fully programmable "problem parser" regex system, which I was able to set up to dismantle standard GCC output.
In my "Custom build target", I set the Output Filter to: `$FILE_PATH$:$LINE$:$COLUMN$:.*`
but that does not seem to have fixed anything.
Is there a way to make this work?
I would _really_ like to switch away from vscode and this should be the last item.
Please sign in to leave a comment.
Hello!
Please try using CLion 2020.1 EAP, file:line:column in compiler messages are now parsed for compilation database projects:
>I guess some other linting or language server tool is doing the parsing and picking those errors up before build even runs?
Errors and warnings in the editor are detected either by CLion's language engine, or by clangd, depending on settings in File | Settings | Languages & Frameworks | C/C++ | Clangd.
>But there also appears to be no "Problems" or "Errors" view, like in VSCode or other IDEs where I can see the detected errors listed.
You can call `Code | Inspect Code...` from the menu and the results will be represented in the Inspection Results tool window.
Great. The EAP version did work.
Is there a fixed release date for the 2020.1 version to be in wide release?
No fixed release date for now. CLion 2020.1 is expected to be released around the first half of April.