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: [committed] diagnostics: add line numbers to source (PR other/84889)


On Thu, 2018-08-09 at 15:40 +0000, Joseph Myers wrote:
> On Thu, 9 Aug 2018, David Malcolm wrote:
> 
> > This patch adds a left margin to the lines of source (and
> > annotations)
> > printed by diagnostic_show_locus, so that e.g. rather than:
> 
> To confirm: if the lines contain tabs anywhere, will the code replace
> them 
> by spaces when a margin is added to ensure that all lines really do
> get 
> consistently indented by the same amount as part of adding the left 
> margin?

I hadn't thought of that; bother.  (that's why we make these kinds of
changes in stage 1).

I'm not sure that we already handled that case properly; the previous
behavior was to print a leading space before the source line.

I'll investigate.

Thanks
Dave


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