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: [CPP] fix some diagnostic locations


>>>>> "Manuel" == Manuel LÃpez-IbÃÃez <lopezibanez@gmail.com> writes:

Manuel> The way CPP builds expressions loses track of the locations of
Manuel> subexpressions. The result is that CPP often points to the
Manuel> wrong location, typically the end of the line. This patch
Manuel> propagates the correct locations.

Thanks.

Manuel> OK for trunk?

Yes, with a little nit fixed; see below.

FWIW -- I have an unfinished patch here that fixes this problem (in a
different way) plus a number of other location-related problems in
libcpp.  I went through most of the cpp test cases in gcc and fixed
them to use column numbers.

The patch breaks some location handling in traditional mode, though,
so I haven't checked it in.  If you plan to do more work in this area,
and you'd like it as a starting point, I can send it.

Manuel>  	  top[-1].value = num_unary_op (pfile, top->value, top->op);
Manuel> +	  top[-1].loc   = top->loc;

Don't line up the '='.  There are a few cases of this.

Tom


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