Saturday 26 November 2011

gcc 4.6.1

The world of compilers should be boring. But I am impressed by
GCC 4.6.1.

Having upgraded my Ubuntu system, I now get the pleasure of the
latest compiler.

After 25+ years of CRiSP development, the code is pretty stable,
and most bad things have been ironed out of the code base. Having
been ported to just about every operating system out there
(from Cray, to a 512K RAM 80186 MSDOS handheld), and used just
about every compiler ever, its refreshing when the compiler takes
warning-free code, and starts telling you about variables which
are set and never used.

Previously, the compiler would warn on a variable defined, but
unused, but wouldn't notice something like:


void func(void)
{ int n;

n = some_other_func();
}


gcc 4.6 does. So, you get to look to see why you are assigning a
result but never using it, and, in some instances, the call to the
function might hint the call is not needed, especially if that
function is a "pure" function.

Nice.

My only complaint now is that its a bit noisier in a couple of other
benign warnings (and hence, its more difficult to see the errors
of interest).

Post created by CRiSP v10.0.18a-b6115


No comments:

Post a Comment