In the discussion of PR 29689, the following came up, and seems like a reasonable request: -------- Original Message (excerpted) -------- Subject: Re: Emacs and GFortran Date: Sat, 4 Nov 2006 07:59:04 +1300 From: Nick Roberts <nickrob@snap.net.nz> CC: fortran@gcc.gnu.org, emacs-devel@gnu.org Newsgroups: gmane.emacs.devel,gmane.comp.gcc.fortran Brooks Moses writes: > The attached only-slightly-less-trivial patch should fix the > regressions, although I have not yet tested it to confirm that. I guess I'm pushing my luck with current feelings, but would it be possible to add the column number? [Previously I wrote: The original error message you posted had column number information in the error output too: gfortran hello.F In file hello.F:3 write(*,) 'Hello!' 1 Error: Syntax error in WRITE statement at (1) it would be nice to be able to use this too. I think gcc outputs kind of information as something like: hello.c:3:13: error: blah, blah, blah... Emacs can then place the cursor in the relevant column when visiting an error (and Vim probably does something similar too).] -- Nick http://www.inet.net.nz/~nickrob
Patch posted to fix this, among other cleanups: http://gcc.gnu.org/ml/fortran/2006-11/msg00151.html
Subject: Bug 29702 Author: brooks Date: Wed Nov 15 03:44:18 2006 New Revision: 118840 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118840 Log: PR fortran/29702 * fortran/error.c (show_loci): Move column-offset calculation to show_locus. (show_locus): Remove blank lines before "Included in" lines, clean up code, calculate column-offsets, print column number is error-header lines as appropriate. (error_integer): (new function) Print integer to error buffer. (error_print): Use error_integer, avoid possible buffer overflows from buggy error formats. * testsuite/lib/gfortran-dg.exp (gfortran-dg-test): Ignore column numbers in error message headers. Modified: branches/gcc-4_2-branch/gcc/fortran/ChangeLog branches/gcc-4_2-branch/gcc/fortran/error.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog branches/gcc-4_2-branch/gcc/testsuite/lib/gfortran-dg.exp
Subject: Bug 29702 Author: brooks Date: Wed Nov 15 04:00:35 2006 New Revision: 118843 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=118843 Log: PR fortran/29702 * fortran/error.c (show_loci): Move column-offset calculation to show_locus. (show_locus): Remove blank lines before "Included in" lines, clean up code, calculate column-offsets, print column number is error-header lines as appropriate. (error_integer): (new function) Print integer to error buffer. (error_print): Use error_integer, avoid possible buffer overflows from buggy error formats. * testsuite/lib/gfortran-dg.exp (gfortran-dg-test): Ignore column numbers in error message headers. Modified: trunk/gcc/fortran/ChangeLog trunk/gcc/fortran/error.c trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/lib/gfortran-dg.exp
Fixed, as per above commits.