errorformat for make.gcc multiline output

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

errorformat for make.gcc multiline output

Wiere Neuer
I'd like to match the following output from gcc via make:

ric.c:1703:18: error: line one
          line two
                  ^~~~~~~~~~~~~~~~~~~~~~ line three (ignore)
                  line four (ignore)

Beside the standard file name, error type, line, and column information, the message should comprise of the text

line 1 line2

I tried the following errorformat expression:

set errorformat=%E%f:%l:%c:\ error:\ %m,
               \%+C%\\(\ %#%\\)%\\@<=%.%#,
               \%-Z\ %#%\\%^%~%#%.%#

which - in my understanding - should translate to

Start an error line           => <file>:<line>:<column>: error <line_one>,
Include the continuation line => \( *\)\@<=.*      // line two, skip whitespace
Finish the error line         =>  *\^~*.*

However, only the first line of the error message is matched, and I receive the GVim error message "E33: No previous substitute regular expression", which stems from the %C pattern.

I think, I don't see the wood because of the trees...

Help greatly appreciated.

You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit

You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit