This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Option to have gcc print full pathnames on error output?
- To: gcc at gcc dot gnu dot org
- Subject: Option to have gcc print full pathnames on error output?
- From: "Brian J. Murrell" <brian_murrell at bctel dot net>
- Date: Wed, 29 Sep 1999 02:05:31 -0700 (PDT)
Right now, using gcc 2.95.1 when gcc finds an error in a .c file it
prints something like:
a.c: In function `main':
a.c:3: `barf' undeclared (first use in this function)
a.c:3: (Each undeclared identifier is reported only once
a.c:3: for each function it appears in.)
a.c:3: parse error before `}'
I am wondering if there is a switch to have it print a full pathname
instead of just the file name as in:
/tmp/srcdir/a.c: In function `main':
/tmp/srcdir/a.c:3: `barf' undeclared (first use in this function)
/tmp/srcdir/a.c:3: (Each undeclared identifier is reported only once
/tmp/srcdir/a.c:3: for each function it appears in.)
/tmp/srcdir/a.c:3: parse error before `}'
The reason I want to do this is that vim (http://www.vim.org) has a mode
called "QuickFix" that fires off the gcc for me and interprets the
output of the gcc looking for error messages, and will take me to the
place in the file where the error is. The problem is that if my cwd is
/tmp and my Makefile there does a "cd srcdir; make" and all vim sees is
"a.c", it doesn't know that a.c is actually in srcdir when it wants to
put me where the error is. If gcc gave the full pathname, vim would be
able to find the file.
Any other solutions welcome of course.
Thanx,
b.
--
Brian J. Murrell InterLinx Support Services, Inc.
North Vancouver, B.C. 604 983 UNIX
Platform and Brand Independent UNIX Support - R3.2 - R4 - BSD