On Wed, 29 Nov 2006, Nikolai Weibull wrote:
> On 11/29/06, Hugh Sasse <[EMAIL PROTECTED]> wrote:
> > This was originally posted to [email protected] but I've not
> > had a reply. Maybe it's better posted here, anyway. This
> > is the concise form of the message. Longer versions are
> > in the archives, but I'll explain more if needed.
>
> Sorry about that. I don't read [email protected] because it's
> signal-to-noise ratio is just terrible.
That's understandable. I'm the same with Ruby-Talk, but because there's
too much signal to read.
>
[...]
>
> Can you please give an example of when this occurs?
I found it from code I generated, but here's a minimal example:
>
<quote>
#include <stdio.h>
int minimal_function(int, int);
int main(int argc, char *argv[]);
int minimal_function(int a, int b)
{
return(a * b);
}
int minimal_function(int a, int b)
{
return(a * b);
}
int main(int argc, char *argv[])
{
int a = 3;
int b = 3;
printf("%d\n", minimal_function(a,b));
return(0);
}
</quote>
> Also, which version of gcc are you using. I suspect that they changed
gcc (GCC) 4.1.0
> the error message in the 4.X series, because I'm not getting this
I think I saw it before.
> message when I think I should be getting it.
This file now works as I'd wish. I've re-ordered the messages to
make the most specific ones appear first, so I won't write this as
a patch (too bulky for this kind of change):
<quote>
" Vim compiler file
" Compiler: GNU C Compiler
" Maintainer: Nikolai Weibull <[EMAIL PROTECTED]>
" Modified: 29-NOV-2006 by Hugh Sasse <[EMAIL PROTECTED]
" Latest Revision: 2006-04-19
if exists("current_compiler")
finish
endif
let current_compiler = "gcc"
let s:cpo_save = &cpo
set cpo-=C
setlocal errorformat=
\%E%f:%l:\ multiple\ definitions\ of\ %m,
\%Z%*\\s:%f:%l:\ first\ defined\ here,
\%-G%f:%l:\ %trror:\ (Each\ undeclared\ identifier\ is\ reported\ only\
once,
\%-G%f:%l:\ %trror:\ for\ each\ function\ it\ appears\ in.),
\\"%f\"\\,\ line\ %l%*\\D%c%*[^\ ]\ %m,
\%D%*\\a[%*\\d]:\ Entering\ directory\ `%f',
\%X%*\\a[%*\\d]:\ Leaving\ directory\ `%f',
\%DMaking\ %*\\a\ in\ %f,
\%*[^\"]\"%f\"%*\\D%l:\ %m,
\\"%f\"%*\\D%l:\ %m,
\%f:%l:\ %m
"
let &cpo = s:cpo_save
unlet s:cpo_save
</quote>
>
> nikolai
>
HTH
Hugh