The War on Error
By commiting a stupid function prototype, which a compiler warning even showed up, I was reminded that I should be using a more efficient way to actually see errors in the middle of several hundred lines of regular output.
Last year, when we faced a similar problem, Brian Boyle and I wrote sexec, which is a tiny little wrapper program which colours stdout green and stderr red. Which means, I can do this;
cd httpd-trunk/
./config.nice
sexec make
and see this:
Through the magic of sexec, errors stick out a mile and are highlighted in red. Yes, on some platforms, gcc can provide colourised output, but this works with everything. See compiler errors, linker warning, make warnings, everything.
And where it comes in really useful is for automated builds or other automated tasks, because sexec can output XML. Here for example is what the error I missed, looks like when using:
1 -Wall -Wmissing-declarations -Wstrict-prototypes -Wmissing-prototypes -Wno-multichar -Wnested-externs -Wno-long-long -Wunused-variable -Wunused-value
For another example of sexec in use, take a look at the ftp.heanet.ie status page, if you click on a project name you’ll get the rsync output from the last run, green output good, red bad.
It doesn’t do proper HTML/XML encoding just yet, eg “&”‘s are output as literal ampersands, not “&”, but it’s good enough as-is for most purposes, especially interactive use. I can leave a compile in the background and spot a warning a mile away.
3 Replies to "The War on Error"
patrol chasing lyrics snow cars on March 31, 2007
snow patrol chasing lyrics cars snow lyrics cars patrol chasing
conall on August 26, 2005
sexec also compiles properly on OS X Tiger. Last time I tried, the configure script was unable to find some required header files in OS X Panther…