Re: [PATCH] Caret diagnostics

2012-04-12 Thread Gabriel Dos Reis
On Thu, Apr 12, 2012 at 11:53 AM, Tom Tromey wrote: >> "Gaby" == Gabriel Dos Reis writes: > > Manuel> So, in fact, libcpp is buggy for not implementing this (as can be seen > Manuel> in emacs). If/When libcpp is fixed, the column info will be correct > Manuel> for tabs. And then, one may care

Re: [PATCH] Caret diagnostics

2012-04-12 Thread Tom Tromey
> "Gaby" == Gabriel Dos Reis writes: Manuel> So, in fact, libcpp is buggy for not implementing this (as can be seen Manuel> in emacs). If/When libcpp is fixed, the column info will be correct Manuel> for tabs. And then, one may care about printing tabs as anything Manuel> different from a sin

Re: [PATCH] Caret diagnostics

2012-04-11 Thread Manuel López-Ibáñez
On 11 April 2012 18:40, H.J. Lu wrote: > > It breaks library tests: > > ERROR: tcl error sourcing > ../../../../src-trunk/boehm-gc/testsuite/../../gcc/testsuite/lib/prune.exp. > ERROR: tcl error sourcing > ../../../../src-trunk/libgomp/testsuite/../../gcc/testsuite/lib/prune.exp. > ERROR: tcl erro

Re: [PATCH] Caret diagnostics

2012-04-11 Thread Mike Stump
On Apr 11, 2012, at 11:15 AM, Manuel López-Ibáñez wrote: > contrib/compare_tests does not seem to detect this :-( I'd bet, either, there were no tests after that point, or, compare_tests pointed it out. Feel free to send the two .sum files and and I will investigate if you think that isn't the

Re: [PATCH] Caret diagnostics

2012-04-11 Thread Andrew Pinski
On Wed, Apr 11, 2012 at 11:15 AM, Manuel López-Ibáñez wrote: > So how can I say in tcl "if not defined VAR then set VAR ""? if ![info exists VAR] { set VAR XXX } Thanks, Andrew Pinski

Re: [PATCH] Caret diagnostics

2012-04-11 Thread Manuel López-Ibáñez
In 11 April 2012 18:40, H.J. Lu wrote: > > It breaks library tests: > > ERROR: tcl error sourcing > ../../../../src-trunk/boehm-gc/testsuite/../../gcc/testsuite/lib/prune.exp. > ERROR: tcl error sourcing > ../../../../src-trunk/libgomp/testsuite/../../gcc/testsuite/lib/prune.exp. > ERROR: tcl erro

Re: [PATCH] Caret diagnostics

2012-04-11 Thread H.J. Lu
On Tue, Apr 10, 2012 at 1:33 PM, Manuel López-Ibáñez wrote: > On 10 April 2012 21:41, Manuel López-Ibáñez wrote: >> On 10 April 2012 21:31, Jason Merrill wrote: >>> On 04/10/2012 12:46 PM, Manuel López-Ibáñez wrote: +  max_width = context->caret_max_width; +  if (max_width<= 0) >>

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Gabriel Dos Reis
On Tue, Apr 10, 2012 at 3:33 PM, Manuel López-Ibáñez wrote: > On 10 April 2012 21:41, Manuel López-Ibáñez wrote: >> On 10 April 2012 21:31, Jason Merrill wrote: >>> On 04/10/2012 12:46 PM, Manuel López-Ibáñez wrote: +  max_width = context->caret_max_width; +  if (max_width<= 0) >>

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Gabriel Dos Reis
On Tue, Apr 10, 2012 at 2:37 PM, Manuel López-Ibáñez wrote: > On 10 April 2012 20:52, Gabriel Dos Reis > wrote: >> On Tue, Apr 10, 2012 at 11:46 AM, Manuel López-Ibáñez >> wrote: >>> On 10 April 2012 00:28, Jason Merrill wrote: On 04/09/2012 04:01 PM, Manuel López-Ibáńez wrote: >

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Gabriel Dos Reis
On Tue, Apr 10, 2012 at 7:54 PM, Mike Stump wrote: > On Apr 10, 2012, at 4:37 PM, Gabriel Dos Reis wrote: You should check the environment first > > >>> I don't think we should have a knob for this. > >> This is fully mystifying to me and I still do not understand what it is all >> about aft

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Jason Merrill
On 04/10/2012 04:33 PM, Manuel López-Ibáñez wrote: A new version of the patch. It removes the special handling of tabs. And abstracts out the adjusting of the line as Gabriel suggested. I am not sure what else could be abstracted out. The function is much shorter than other functions in diagnosti

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Mike Stump
On Apr 10, 2012, at 4:37 PM, Gabriel Dos Reis wrote: >>> You should check the environment first >> I don't think we should have a knob for this. > This is fully mystifying to me and I still do not understand what it is all > about after reading it 8 times. Let me rephrase, I disagree, we shoul

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Gabriel Dos Reis
On Tue, Apr 10, 2012 at 5:23 PM, Mike Stump wrote: > On Apr 10, 2012, at 11:52 AM, Gabriel Dos Reis wrote: >> On Tue, Apr 10, 2012 at 11:46 AM, Manuel López-Ibáñez >> wrote: >>> On 10 April 2012 00:28, Jason Merrill wrote: On 04/09/2012 04:01 PM, Manuel López-Ibáńez wrote: > > * It

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Mike Stump
On Apr 10, 2012, at 11:52 AM, Gabriel Dos Reis wrote: > On Tue, Apr 10, 2012 at 11:46 AM, Manuel López-Ibáñez > wrote: >> On 10 April 2012 00:28, Jason Merrill wrote: >>> On 04/09/2012 04:01 PM, Manuel López-Ibáńez wrote: * It uses the default cutoff as max_width, whatever it is (as >

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Manuel López-Ibáñez
On 10 April 2012 21:41, Manuel López-Ibáñez wrote: > On 10 April 2012 21:31, Jason Merrill wrote: >> On 04/10/2012 12:46 PM, Manuel López-Ibáñez wrote: >>> >>> +  max_width = context->caret_max_width; >>> +  if (max_width<= 0) >>> +    max_width = INT_MAX; >> >> >> I don't think we need the test

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Manuel López-Ibáñez
On 10 April 2012 21:31, Jason Merrill wrote: > On 04/10/2012 12:46 PM, Manuel López-Ibáñez wrote: >> >> +  max_width = context->caret_max_width; >> +  if (max_width<= 0) >> +    max_width = INT_MAX; > > > I don't think we need the test here; diagnostic_set_caret_max_width should > make sure caret_

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Manuel López-Ibáñez
On 10 April 2012 20:52, Gabriel Dos Reis wrote: > On Tue, Apr 10, 2012 at 11:46 AM, Manuel López-Ibáñez > wrote: >> On 10 April 2012 00:28, Jason Merrill wrote: >>> On 04/09/2012 04:01 PM, Manuel López-Ibáńez wrote: * It uses  the default cutoff as max_width, whatever it is (as co

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Jason Merrill
On 04/10/2012 12:46 PM, Manuel López-Ibáñez wrote: + max_width = context->caret_max_width; + if (max_width<= 0) +max_width = INT_MAX; I don't think we need the test here; diagnostic_set_caret_max_width should make sure caret_max_width is set sensibly. Otherwise, yes, thanks. On 04/10/

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Gabriel Dos Reis
On Tue, Apr 10, 2012 at 11:46 AM, Manuel López-Ibáñez wrote: > On 10 April 2012 00:28, Jason Merrill wrote: >> On 04/09/2012 04:01 PM, Manuel López-Ibáńez wrote: >>> >>> * It uses  the default cutoff as max_width, whatever it is (as >>> controlled by -fmessage-length). >>> * It uses the pretty-pr

Re: [PATCH] Caret diagnostics

2012-04-10 Thread Manuel López-Ibáñez
On 10 April 2012 00:28, Jason Merrill wrote: > On 04/09/2012 04:01 PM, Manuel López-Ibáńez wrote: >> >> * It uses  the default cutoff as max_width, whatever it is (as >> controlled by -fmessage-length). >> * It uses the pretty-printer. The text cannot (should not) wrap >> because we still print on

Re: [PATCH] Caret diagnostics

2012-04-09 Thread Jason Merrill
On 04/09/2012 04:01 PM, Manuel López-Ibáñez wrote: * It uses the default cutoff as max_width, whatever it is (as controlled by -fmessage-length). * It uses the pretty-printer. The text cannot (should not) wrap because we still print only max_width chars at most. Hmm, I think if pp_line_cutoff

Re: [PATCH] Caret diagnostics

2012-04-09 Thread Manuel López-Ibáñez
Attached a new version of the patch: * It uses the default cutoff as max_width, whatever it is (as controlled by -fmessage-length). * It uses the pretty-printer. The text cannot (should not) wrap because we still print only max_width chars at most. * It removes unnecessary prune patterns. Bootst

Re: [PATCH] Caret diagnostics

2012-04-08 Thread Jason Merrill
On 04/08/2012 12:13 PM, Manuel López-Ibáñez wrote: To focus on the issue at hand, and independently of whether any bugs exist or not, and whether I am capable or not to fix them. What you are proposing is to change the current default of no line-wrapping to line-wrap at getenv("COLUMNS"), isn't i

Re: [PATCH] Caret diagnostics

2012-04-08 Thread Gabriel Dos Reis
On Sun, Apr 8, 2012 at 11:52 AM, Manuel López-Ibáñez wrote: > On 8 April 2012 18:35, Gabriel Dos Reis wrote: >> On Sun, Apr 8, 2012 at 11:13 AM, Manuel López-Ibáñez >> wrote: >>> On 8 April 2012 06:09, Jason Merrill wrote: On 04/07/2012 06:29 PM, Manuel López-Ibáńez wrote: > +gete

Re: [PATCH] Caret diagnostics

2012-04-08 Thread Manuel López-Ibáñez
On 8 April 2012 18:35, Gabriel Dos Reis wrote: > On Sun, Apr 8, 2012 at 11:13 AM, Manuel López-Ibáñez > wrote: >> On 8 April 2012 06:09, Jason Merrill wrote: >>> On 04/07/2012 06:29 PM, Manuel López-Ibáńez wrote: >>> +getenv_columns (void) >>> >>> >>> I had been thinking to check COLUMNS on

Re: [PATCH] Caret diagnostics

2012-04-08 Thread Gabriel Dos Reis
On Sun, Apr 8, 2012 at 11:13 AM, Manuel López-Ibáñez wrote: > On 8 April 2012 06:09, Jason Merrill wrote: >> On 04/07/2012 06:29 PM, Manuel López-Ibáńez wrote: >> >>> +getenv_columns (void) >> >> >> I had been thinking to check COLUMNS once at the beginning of compilation; I >> don't think the va

Re: [PATCH] Caret diagnostics

2012-04-08 Thread Gabriel Dos Reis
On Sun, Apr 8, 2012 at 11:10 AM, Manuel López-Ibáñez wrote: > On 8 April 2012 17:14, Gabriel Dos Reis wrote: >> On Sun, Apr 8, 2012 at 7:06 AM, Manuel López-Ibáñez >> wrote: >>> On 8 April 2012 06:09, Jason Merrill wrote: On 04/07/2012 06:29 PM, Manuel López-Ibáńez wrote: > > I'll

Re: [PATCH] Caret diagnostics

2012-04-08 Thread Manuel López-Ibáñez
On 8 April 2012 06:09, Jason Merrill wrote: > On 04/07/2012 06:29 PM, Manuel López-Ibáńez wrote: > >> +getenv_columns (void) > > > I had been thinking to check COLUMNS once at the beginning of compilation; I > don't think the value can change while the compiler is running since we > don't respond

Re: [PATCH] Caret diagnostics

2012-04-08 Thread Manuel López-Ibáñez
On 8 April 2012 17:14, Gabriel Dos Reis wrote: > On Sun, Apr 8, 2012 at 7:06 AM, Manuel López-Ibáñez > wrote: >> On 8 April 2012 06:09, Jason Merrill wrote: >>> On 04/07/2012 06:29 PM, Manuel López-Ibáńez wrote: I'll be happy to change it to whatever is more understandable. I think >>>

Re: [PATCH] Caret diagnostics

2012-04-08 Thread Gabriel Dos Reis
On Sun, Apr 8, 2012 at 7:06 AM, Manuel López-Ibáñez wrote: > On 8 April 2012 06:09, Jason Merrill wrote: >> On 04/07/2012 06:29 PM, Manuel López-Ibáńez wrote: >>> >>> I'll be happy to change it to whatever is more understandable. I think >>> in CSS is called "padding". >> >> >> That wouldn't be a

Re: [PATCH] Caret diagnostics

2012-04-08 Thread Manuel López-Ibáñez
On 8 April 2012 06:09, Jason Merrill wrote: > On 04/07/2012 06:29 PM, Manuel López-Ibáńez wrote: >> >> I'll be happy to change it to whatever is more understandable. I think >> in CSS is called "padding". > > > That wouldn't be any clearer; my confusion was that I thought you were > padding the ri

Re: [PATCH] Caret diagnostics

2012-04-07 Thread Jason Merrill
On 04/07/2012 06:29 PM, Manuel López-Ibáñez wrote: I'll be happy to change it to whatever is more understandable. I think in CSS is called "padding". That wouldn't be any clearer; my confusion was that I thought you were padding the right side of the source line, but you aren't; you are only

Re: [PATCH] Caret diagnostics

2012-04-07 Thread Manuel López-Ibáñez
On 7 April 2012 04:31, Jason Merrill wrote: > On 04/06/2012 06:30 PM, Manuel López-Ibáñez wrote: >>> >>> width if it's set; otherwise I would lean toward unlimited width. And I'm >>> not sure why we need a right margin at all. >> >> >> The right margin is because: > >>[snip] > > Ah, I read "margin

Re: [PATCH] Caret diagnostics

2012-04-06 Thread Jason Merrill
On 04/06/2012 06:30 PM, Manuel López-Ibáñez wrote: width if it's set; otherwise I would lean toward unlimited width. And I'm not sure why we need a right margin at all. The right margin is because: >[snip] Ah, I read "margin" and assumed it meant you were leaving blank space at the right sid

Re: [PATCH] Caret diagnostics

2012-04-06 Thread Manuel López-Ibáñez
On 7 April 2012 00:04, Jason Merrill wrote: > On 04/06/2012 04:11 AM, Manuel López-Ibáńez wrote: >> >> +++ gcc/testsuite/gcc.dg/torture/tls/tls.exp    (working copy) >> @@ -48,10 +48,10 @@ dg-init >>  torture-init >>  set-torture-options $TLS_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS >> >>  # Main

Re: [PATCH] Caret diagnostics

2012-04-06 Thread Jason Merrill
On 04/06/2012 04:11 AM, Manuel López-Ibáñez wrote: +++ gcc/testsuite/gcc.dg/torture/tls/tls.exp(working copy) @@ -48,10 +48,10 @@ dg-init torture-init set-torture-options $TLS_TORTURE_OPTIONS {{}} $LTO_TORTURE_OPTIONS # Main loop. gcc-dg-runtest [lsort [glob -nocomplain $srcdir/$subdir/*

Re: [PATCH] Caret diagnostics

2012-04-06 Thread Manuel López-Ibáñez
On 6 April 2012 15:42, Mike Stump wrote: > On Apr 6, 2012, at 1:11 AM, Manuel López-Ibáñez wrote: >> A simple implementation of caret diagnostics. >> >> In the testsuite, pruning the caret output does not always work >> because of several known deficiencies of DejaGNU, thus in some places >> I dis

Re: [PATCH] Caret diagnostics

2012-04-06 Thread Mike Stump
On Apr 6, 2012, at 1:11 AM, Manuel López-Ibáñez wrote: > A simple implementation of caret diagnostics. > > In the testsuite, pruning the caret output does not always work > because of several known deficiencies of DejaGNU, thus in some places > I disable the caret explicitly. > > Bootstrapped and