Reverse order diagnostics
Jonathan Wakely
jwakely.gcc@gmail.com
Mon Apr 8 09:24:00 GMT 2019
On Sun, 7 Apr 2019 at 19:47, LRN wrote:
>
> On 05.04.2019 13:19, Jonathan Wakely wrote:
> > On Thu, 4 Apr 2019 at 19:52, LRN wrote:
> >>
> >> Is there a way to make gcc output errors and warnings in reverse order, so that
> >> the first error is printed last? I know that i can buffer gcc output in a
> >> separate program that then reverses it, but:
> >> 1) It would reverse the whole thing (meaning that multiline messages will also
> >> have to be read bottom-to-top)
> >> 2) This might not interact with -fdiagnostics-color correctly (especially if
> >> colored output is not achieved by inserting escape codes).
> >
> > It is achieved using escape codes.
>
> Ah, my bad. For a second i thought that there's pre-10 Windows support in gcc.
> Obviously, that's not the case.
Eh?
The MinGW builds of GCC support older version of Windows just fine.
Colourful diagnostics are not required for correct functioning of the compiler.
> >
> > I often use a shell function that does this:
> >
> > gcc ... -fdiagnostics-color | less --quit-if-one-screen --RAW-CONTROL-CHARS
> >
> > This way the first error doesn't scroll off the screen.
> >
>
> Wait, what? You build software by running gcc manually, for each file in your
> software project? You're not even using makefiles?
Did I say that?
I assumed it wasn't necessary to show, but you can do the same when using make:
make CFLAGS+=-fdiagnostics-color 2>&1 | less --quit-if-one-screen
--RAW-CONTROL-CHARS
More information about the Gcc-help
mailing list