vim errorformat requires updating for gcc 4.5 unreleased

21 views
Skip to first unread message

Chris

unread,
Nov 11, 2009, 11:29:30 PM11/11/09
to vim...@vim.org
gcc 4.5 unreleased contains a column number for the "In file included from"
gcc 4.4 did not.
errorformat does not skip over the first line.
/opt/gcc-4.5/bin/g++ -std=c++0x -fshow-column c.cpp
In file included from a.h:3:0,
from c.cpp:2:
b.h:3:1: error: ‘dscfsdjvcsdfvsdf’ does not name a type
c.cpp:9:17: error: ISO C++ forbids declaration of ‘Params’ with no type
c.cpp:9:24: error: expected ‘,’ or ‘...’ before ‘&’ token
c.cpp: In function ‘int main()’:
c.cpp:16:2: error: ‘Params’ was not declared in this scope
c.cpp:16:9: error: expected ‘;’ before ‘p’
c.cpp:17:7: error: ‘p’ was not declared in this scope

Chris

unread,
Nov 16, 2009, 7:16:01 PM11/16/09
to vim...@googlegroups.com
Here are some lines I added to my errorformat to ignore:
In file included from... with and without column.

%-GIn\ file\ included\ from\ %f:%l:%c\\,
%-GIn\ file\ included\ from\ %f:%l\\,
%-Gfrom\ %f:%l\\,
%-Gfrom\ %f:%l:%c\\,

Bram Moolenaar

unread,
Nov 17, 2009, 6:41:39 AM11/17/09
to Chris, vim...@googlegroups.com

Chris Indy wrote:

> Here are some lines I added to my errorformat to ignore:
> In file included from... with and without column.
>
> %-GIn\ file\ included\ from\ %f:%l:%c\\,
> %-GIn\ file\ included\ from\ %f:%l\\,
> %-Gfrom\ %f:%l\\,
> %-Gfrom\ %f:%l:%c\\,

Please check if this patch works. I put the messages with :%c first,
I'm not sure if that makes any difference.

*** ../vim-7.2.296/src/option.h 2008-06-24 23:59:49.000000000 +0200
--- src/option.h 2009-11-17 12:38:11.000000000 +0100
***************
*** 33,39 ****
# ifdef EBCDIC
#define DFLT_EFM "%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m"
# else
! #define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%D%*\\a: Entering directory `%f',%X%*\\a: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m"
# endif
# endif
# endif
--- 33,39 ----
# ifdef EBCDIC
#define DFLT_EFM "%*[^ ] %*[^ ] %f:%l%*[ ]%m,%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m"
# else
! #define DFLT_EFM "%*[^\"]\"%f\"%*\\D%l: %m,\"%f\"%*\\D%l: %m,%-G%f:%l: (Each undeclared identifier is reported only once,%-G%f:%l: for each function it appears in.),%-GIn file included from %f:%l:%c,%-GIn file included from %f:%l,%-Gfrom %f:%l:%c,%-Gfrom %f:%l,%f:%l:%c:%m,%f(%l):%m,%f:%l:%m,\"%f\"\\, line %l%*\\D%c%*[^ ] %m,%D%*\\a[%*\\d]: Entering directory `%f',%X%*\\a[%*\\d]: Leaving directory `%f',%D%*\\a: Entering directory `%f',%X%*\\a: Leaving directory `%f',%DMaking %*\\a in %f,%f|%l| %m"
# endif
# endif
# endif


--
Mrs Abbott: I'm a paediatrician.
Basil: Feet?
Mrs Abbott: Children.
Sybil: Oh, Basil!
Basil: Well, children have feet, don't they? That's how they move
around, my dear. You must take a look next time, it's most
interesting. (Fawlty Towers)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ download, build and distribute -- http://www.A-A-P.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///

Chris

unread,
Nov 17, 2009, 4:55:19 PM11/17/09
to Bram Moolenaar, vim...@googlegroups.com
Hi, the patch does not work.
Some problems:
- The error contains a comma at the end (\\,) or a colon :
This can be done by adding
%*[\\,:]
- I don't know if it is necessary to use the "from" lines.


I tried a few things in errorformats, but I could not get the desired
effect. I don't know if it is possible.

A shell console for a simple include chain would give

/opt/gcc-4.5/bin/g++ main.cpp
In file included from b.h:1:0,
from c.h:1,
from main.cpp:1:
a.h:4:1: error: ‘csdcsd’ does not name a type
make: *** [all] Error 1

The vim error console window.
|| /opt/gcc-4.5/bin/g++ main.cpp
|| from c.h:1,
|| from main.cpp:1:
a.h|4 col 1| error: ‘csdcsd’ does not name a type
|| make: *** [all] Error 1

I guess the accurate thing to do would be ignore but display the "In
file included" and "from" lines.

Reply all
Reply to author
Forward
0 new messages