GCC Output color formatter
Moderator: Stef
-
- Very interested
- Posts: 86
- Joined: Fri Sep 25, 2015 4:16 pm
GCC Output color formatter
The old version of GCC used with SGDK drives me insane because 1) SGDK spits out a lot of warnings unless you squash them with type casting on resources, and 2) there is no colorization to let you find the one error admist twenty warnings.
I put together a tiny python script towards which you can pipe GCC's error output:
https://github.com/Mikejmoffitt/gccerrc/
Install python3 if your distro hasn't already got it, and configure your makefile in a way that is similar to the usage example shown (on the line with $(CC), add 2>&1 | python3 gccerrc.py)
I put together a tiny python script towards which you can pipe GCC's error output:
https://github.com/Mikejmoffitt/gccerrc/
Install python3 if your distro hasn't already got it, and configure your makefile in a way that is similar to the usage example shown (on the line with $(CC), add 2>&1 | python3 gccerrc.py)
Last edited by mikejmoffitt on Thu Oct 29, 2015 5:40 pm, edited 1 time in total.
-
- Very interested
- Posts: 86
- Joined: Fri Sep 25, 2015 4:16 pm
Re: GCC Output color formatter
I realize I should have put this in tools...
Re: GCC Output color formatter
Windows console supports color ?
Re: GCC Output color formatter
Yeah (16 colors), although not through ANSI escape codes. This is Python though so maybe its API takes care of that anyway? (no idea how it works)
Sik is pronounced as "seek", not as "sick".
Re: GCC Output color formatter
Code: Select all
print ('\033[1m', end = "");
Re: GCC Output color formatter
I never used this because Eclipse does it for me but did you look at
https://github.com/chinaran/color-compile ?
It seems to achieve the same thing (and even more ?)
https://github.com/chinaran/color-compile ?
It seems to achieve the same thing (and even more ?)
-
- Very interested
- Posts: 86
- Joined: Fri Sep 25, 2015 4:16 pm
Re: GCC Output color formatter
I have no idea if this will work well in a Windows workflow, so I can't comment on that. No real API is in use here, it's just ANSI escape sequences.
As for the other program, there are several which do similar functionality but I wanted this one as a Python script so when I go between a computer running Darwin and Linux I don't have to recompile the formatter or maintain multiple binaries.
As for the other program, there are several which do similar functionality but I wanted this one as a Python script so when I go between a computer running Darwin and Linux I don't have to recompile the formatter or maintain multiple binaries.