"Nikolai Weibull" <now / bitwi.se> writes:

> On 8/21/06, Hugh Sasse <hgs / dmu.ac.uk> wrote:
>
>> And finally, should I just shut up?
>
> No!  Considering that a lot of code (basically any Ruby program)
> relies on this code being correct, running the Ruby sources through
> the most stringent checking makes sense.  Not that I doubt the skills
> of the devs, but everyone makes mistakes.  I can't count the number of
> hard-to-find-otherwise bugs that have been caught by -Wall and some of
> the other more hard-core -W-switches.

Ditto.  I'm a fan of '-Wall -Wextra -Werror' [1] myself ;-).  In my
experience (150 KSLOC project with complex extension system and fiddly
bits in assembly) it's perfectly feasible to achieve *no* warnings,
even when targeting multiple compilers (gcc and SunW in my project's
case).  It took a little more effort, but we caught a massive number
of errors that way.

The one issue with using '-Wall -Wextra' with gcc is that you have to
add a lot of gcc-specific annotations e.g., indicating intentionally
unused arguments.  Not so big a deal if you're doing it from the
start, but I just tried it on ruby (1.8.4, what I have sitting around)
and got nearly 1000 warnings.  Ouch.

[1] The '-W' option becomes '-Wextra' with gcc 4.x

-Marshall