Bug 29702 - RFE: Column number in error messages.
Summary: RFE: Column number in error messages.
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.3.0
: P3 enhancement
Target Milestone: ---
Assignee: Brooks Moses
URL:
Keywords:
Depends on: 29689
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-03 20:24 UTC by Brooks Moses
Modified: 2006-11-15 04:02 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-11-07 04:35:12


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Brooks Moses 2006-11-03 20:24:19 UTC
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
Comment 1 Brooks Moses 2006-11-07 04:35:12 UTC
Patch posted to fix this, among other cleanups:
http://gcc.gnu.org/ml/fortran/2006-11/msg00151.html
Comment 2 Brooks Moses 2006-11-15 03:44:37 UTC
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

Comment 3 Brooks Moses 2006-11-15 04:00:46 UTC
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

Comment 4 Brooks Moses 2006-11-15 04:02:52 UTC
Fixed, as per above commits.