This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH to print column numbers in diagnostics


Per Bothner <per@bothner.com> writes:

| This patch prints the column number if non-zero, but only
| if USE_MAPPED_LOCATION.  So for now it has limited usefulness,
| and it may be reasonable to defer until after the branch.
| On the other hand, it seems pretty safe, and it may encourage
| people to save column numbers in declarations and expressions.
| An ilustration where this patch makes a difference, see this
| patch: http://gcc.gnu.org/ml/gcc-patches/2005-02/msg00594.html
| 
| Here is a C++ example:
| void foo ()
| {
|    int x;
|    int y;
|    int x;
| }
| /tmp/err.cc: In function Âvoid foo()Â:
| /tmp/err.cc:5:3: error: redeclaration of Âint xÂ
| /tmp/err.cc:3:3: error: Âint x previously declared here
| 
| As an aside:  Column 7 (the column of the declared identifier)
| would be more useful than column 3 (the start column of the
| declaration); consider: 'int x, y, x;'.  Changing this would
| presumably be a modest fix to the C++ parser.
| 
| Ok after 4.0 has branched?  Ok now?

I think this is post-4.0 material.  Queued.

-- Gaby


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]