Vala and C warnings

We’re frantic here at Yorba working to get Shotwell 0.4 out the door before the holidays, but I wanted to take a breather and point out a positive trend I’ve noticed with the Vala compiler.

As you may or may not know, Yorba is a 100% Vala shop — well, maybe not 100%, but the sliver of code that’s not Vala (and I’m including Make as a kind of scripting engine) is present only out of necessity.

We were sold on Vala from just about the beginning of Yorba’s existence.  One major concern was the number of C warnings gcc spat out when compiling valac’s generated source.  I’m from the medieval school of thought where Wernings Shalt Be Treatyd As Errours, but unfortunately there’s little recourse with a system like Vala.  Each warning had its own root cause.  There was no central fix that could be made to the compiler, nor was it a simple matter of rewriting the offending line.  Many warnings were due to const-correctness.

Recently I’ve noticed fewer warnings than ever.  Shotwell is approaching the 25,000-line ceiling (according to wc, blank lines stripped) and I was curious what kind of trend there’s been on warnings.  It’s positive all right:

18-Mar-2009 Vala 0.5.7: 746 lines, 4 warnings, 0.54% lines generating warnings
12-Apr-2009 Vala 0.6.1: 2,789 lines, 8 warnings, 0.29%
20-Apr-2009 Vala 0.6.1: 3,160 lines, 11 warnings, 0.35%
26-May-2009 Vala 0.7.3: 6,347 lines, 57 warnings, 0.90%
28-Jun-2009 Vala 0.7.3: 8,663 lines, 79 warnings, 0.91%
18-Sep-2009 Vala 0.7.5: 15,270 lines, 131 warnings, 0.86%
17-Dec-2009, Vala 0.7.8: 24,591 lines, 56 warnings, 0.23%

I suppose I could go crazy with the graphs, but you get the point: Shotwell’s code size is growing and the rate of warnings are dropping.  The big leap was between 0.7.5 and 0.7.8, which justifies my hunch that this was a recent development.

(I ran 18-Mar for giggles.  I don’t think a program under 1,000 lines is worth measuing in this context, but it’s fun to remember when Shotwell was just a tot.)

Zero warnings are, of course, the final goal here, but I’d say that Vala’s largest improvement of late has been its growing silence.  When you think about it, that’s what you’re really wishing for when you type “make”.

2 thoughts on “Vala and C warnings”

Leave a Reply to Noriko Haislip Cancel reply

Your email address will not be published. Required fields are marked *