Files
Andrey Starodoubtsev 683dabcb91 runtime(iar): Improve support for IAR compiler
1. Error message can start from long word or the path to the file can be
   long; in both of these cases the message will be moved to the next
   line:

```
"/tmp/test_test_test_test_test_test_test_test_test.c",3  Error[Pe077]:
          this declaration has no storage class or type specifier
```

To handle this `errorformat` will consider leading space as part of the
error message.

2. Some of the messages have `[note]:` prefix.

3. When messages come one after another, `%Z` is required to separate
   them.

closes: #21360

Signed-off-by: Andrey Starodoubtsev <andrey.starodoubtsev@gehealthcare.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
2026-09-25 21:03:03 +00:00

35 lines
843 B
VimL

" Vim compiler file
" Compiler: IAR Systems C/C++ Compiler
if exists("current_compiler")
finish
endif
let current_compiler = "iar"
let s:cpo_save = &cpo
set cpo&vim
" abc;
" ^
" "/tmp/test.c",3 Error[Pe077]: this
" declaration has no storage class or type specifier
" Error[Li005]: no definition for "Foo::Foo(unsigned shor
" t, unsigned short, unsigned int, char const *)"
" [referenced from Bar.o(libBar.a)]
CompilerSet errorformat=
\%A\ \ %p^,
\%C\"%f\"\\\,%l\ \ Remark[%*[^]]]:%m,
\%C\"%f\"\\\,%l\ \ %tarning[%*[^]]]:%m,
\%C\"%f\"\\\,%l\ \ %trror[%*[^]]]:%m,
\%C\"%f\"\\\,%l\ \ Fatal\ %trror[%*[^]]]:%m,
\%C\"%f\"\\\,%l\ \ [note]:%m,
\%EInternal\ error:%m,
\%EError[%*[^]]]:%m,
\%C%\\s%\\+%m,
\%Z
let &cpo = s:cpo_save
unlet s:cpo_save