This is the mail archive of the gcc@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: error printing in reversed order ?


oops this works better:
alias reversed_make='make 2>&1 >/dev/null | tac | egrep --color
"\b(error|cpp|hpp)\b|$"'

On Fri, Oct 7, 2016 at 4:39 PM, nicolas bouillot
<nicolas.bouillot@gmail.com> wrote:
> Thank you Joe and Dave.
>
> I tried -fmax-errors but my test error (c++ iterator type) is itself
> very long and still requires scrolling. In this case I had success
> with tac. It just need to get some color back after filtering, which
> is resulting for me in this following alias:
> alias reversed_make='make 2>&1 >/dev/null | tac | egrep --color
> "\b(error|cpp|hpp)\b|$ "'
>
> Nicolas
>
> On Fri, Oct 7, 2016 at 3:23 PM, David Malcolm <dmalcolm@redhat.com> wrote:
>> On Fri, 2016-10-07 at 15:08 -0400, nicolas bouillot wrote:
>>> Hi,
>>>
>>> Was wondering this could be a feature request ? Basically, this could
>>> be a GCC option to print compilation errors in a reversed order, i.e.
>>> the first being printed last. This is because when compiling from the
>>> terminal, it would avoid mouse scrolling all day in order to get the
>>> first error.
>>>
>>> I'll be happy to write a feature request somewhere if this deserves
>>> it, but I do not know where and if this can be considered as a
>>> feature
>>> request.
>>
>> There's an option
>>   -fmax-errors=
>> which can be set to limit the number of errors emitted.
>>
>> It defaults to off.  The clang equivalent, -ferror-limit=, defaults to
>> 20.
>>
>> Maybe we should change -fmax-errors= to default to on, maybe 20?  This
>> ought to solve the "scrolling all day" problem you describe.
>>
>> Also, our error message is "computerese":
>>
>>   compilation terminated due to -fmax-errors=2.
>>
>> clang's is better:
>>
>>   fatal error: too many errors emitted, stopping now [-ferror-limit=]
>>
>> but we could improve ours by showing the number after the option), and
>> say how to disable the limiter:
>>
>>   fatal error: too many errors emitted, stopping now [-fmax-errors=2]
>>
>> note: use -fmax-errors=0 to print all errors
>>
>> or somesuch.
>>
>> Thoughts?
>>
>> Dave


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