[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] Compiling 1.17.0 issues



Hi,

On tiistai 24 toukokuu 2011, Alan Hourihane wrote:
> On 05/24/11 15:01, Miro Kropáček wrote:
> >     The 1.17 branch unfortunately requires gcc 4.3/4.4.
> > 
> > Isn't just easier to drop -Werror than require another gcc version? It
> > has very little practical meaning (and is constant source of "source
> > tree doesn't compile" emails), everyone so concerned if some warning
> > didn't slip out can enable it in his local tree...
> 
> I suppose we could do it just on the 1.17 branch, but it's there to
> catch developer build problems. It's not there just because I felt like
> it.

Couldn't developer just use e.g. "colorgcc" to highlight warnings?


Or use something like this to get same effect as from -Werror:
	make 2>&1 | tee build.log |  awk '{print} /warning:/{exit}'

-> Awk exiting on first warning propagates SIGPIPE to rest of pipeline
    and interrupts the build.

(The full log goes to build.log which may sometimes contain a bit of extra
lines due to buffering.)

And when developer doesn't want build to stop on warnings, he can just
remove awk from the command line.  (Always having full log is good
practice.)


Or one could add limits to the awk script on how many warnings it accepts
per given file... If you have known warnings say for "foobar.c" file, you
could use something like this (untested):
---
{print}			# print every line
/gcc / {			# zero warning counter for every compilation unit
	count=0;
}
/warning:/ {		# increase warning count
	count+=1;
}
/foobar.c:/ {		# if given file, but count below limit, skip
	if (count<3) next;
}
{				# otherwise exit if any warnings
	if (count) exit;
}
---

If there are known harmless warnings for given compiler versions, MiNT could
even ship these kind of awk files that count & skip known amount of warnings
for listed sets of files:
	make 2>&1 | tee build.log |  awk -f mint-gcc-4.4-checks.awk
:-)

	- Eero