Re: [RFC diagnostics/fortran] Move gfc_warning (buffered) to the common diagnostics machinery

2014-12-01 Thread Dodji Seketeli
Manuel López-Ibáñez lopeziba...@gmail.com writes: * Dodji: Do the common diagnostics part look reasonable? Yes they do. I just have one minor comment nit: [...] Index: gcc/pretty-print.h [...] + + /* Nonzero means that text should be flushed when + appropriate. Otherwise, text is

Re: [RFC diagnostics/fortran] Move gfc_warning (buffered) to the common diagnostics machinery

2014-11-28 Thread Dominique Dhumieres
Tobias Burnus wrote: Actually, I wonder whether that can lead to printing an error message multiple times. This already occurs, see pr44978. Dominique

[RFC diagnostics/fortran] Move gfc_warning (buffered) to the common diagnostics machinery

2014-11-27 Thread Manuel López-Ibáñez
This is just a RFC so no Changelog yet. It bootstraps and passes the testsuite. I have three major questions: * Dodji: Do the common diagnostics part look reasonable? I tried to be as least invasive as possible. If you have comments or suggestions they are very welcome. * Fortran devs: Is this

Re: [RFC diagnostics/fortran] Move gfc_warning (buffered) to the common diagnostics machinery

2014-11-27 Thread Steve Kargl
On Thu, Nov 27, 2014 at 06:25:01PM +0100, Manuel López-Ibáñez wrote: The ugliest part is how to handle warningcount and werrorcount. I could handle this in the common machinery in a better way by storing DK_WERROR in the diagnostic-kind and checking it after printing. This way we can first

Re: [RFC diagnostics/fortran] Move gfc_warning (buffered) to the common diagnostics machinery

2014-11-27 Thread Tobias Burnus
Manuel López-Ibáñez wrote: * Fortran devs: Is this approach acceptable? The main idea is to have an output_buffer called pp_warning_buffer with the flush_p bit unset if we are buffering. When printing buffered warnings, use this output_buffer in the global_dc-printer instead of the (unbuffered

Re: [RFC diagnostics/fortran] Move gfc_warning (buffered) to the common diagnostics machinery

2014-11-27 Thread Manuel López-Ibáñez
On 27 November 2014 at 20:28, Tobias Burnus bur...@net-b.de wrote: I think the approach is fine. As the _now version overrides the buffer, one might even do with a single buffer by clearing it, setting flush_p temporarily to true and printing the message. It only might collide with buffered

Re: [RFC diagnostics/fortran] Move gfc_warning (buffered) to the common diagnostics machinery

2014-11-27 Thread Manuel López-Ibáñez
On 27 November 2014 at 22:33, Manuel López-Ibáñez lopeziba...@gmail.com wrote: On 27 November 2014 at 20:28, Tobias Burnus bur...@net-b.de wrote: I think the approach is fine. As the _now version overrides the buffer, one might even do with a single buffer by clearing it, setting flush_p

Re: [RFC diagnostics/fortran] Move gfc_warning (buffered) to the common diagnostics machinery

2014-11-27 Thread Tobias Burnus
Manuel López-Ibáñez wrote: Oh, I didn't notice that the _now versions override the buffered messages. Where do you see that? I think I messed up a bit - they do not seem to get cleared. I was reading gfc_error_now_1, which has: error_buffer.flag = 1; error_buffer.index = 0;

Re: [RFC diagnostics/fortran] Move gfc_warning (buffered) to the common diagnostics machinery

2014-11-27 Thread Manuel López-Ibáñez
On 27 November 2014 at 23:58, Tobias Burnus bur...@net-b.de wrote: Manuel López-Ibáñez wrote: Sure, but I would like to test specifically triggering and discarding the gfc_warning that I converted (or another single one that you suggest), if this were possible. Hmm, theoretically, it would

Re: [RFC diagnostics/fortran] Move gfc_warning (buffered) to the common diagnostics machinery

2014-11-27 Thread Tobias Burnus
Manuel López-Ibáñez wrote: On 27 November 2014 at 23:58, Tobias Burnus bur...@net-b.de wrote: Hmm, theoretically, it would be possible. However, my feeling is that there is no such case. What would be needed is something which is ambiguous, the compiler assumes first the wrong kind of