LWN.net Logo

LLVM 2.9 released

LLVM 2.9 released

Posted Apr 12, 2011 17:33 UTC (Tue) by hamjudo (subscriber, #363)
In reply to: LLVM 2.9 released by lkundrak
Parent article: LLVM 2.9 released

I worked on a proprietary software package with 15 to 25 full time programmers. We used -Werror and -Wall on the nightly build for years, and they were still using it when I left. You can disable individual warnings, if desired. When we first turned on -Werror and -Wall, we had to disable many warnings. We were down to only about 4 when I left.

It is easy to write a script in Perl, Python, or the scripting language of your choice to rewrite individual lines of code so they no longer trigger a warning. I'd re-enable one warning at a time. If it only showed up in a few places, I would rewrite them by hand. If there were hundreds or thousands of errors, then I would code a script. Keep in mind that gcc politely gives the line numbers and filenames for each warning. So the script didn't have to hunt down the noncompliant code, it just had to fix the lines known to trigger the warnings.

Being lazy, I coded the scripts to look for the most common safe ways that our programmers had annoyed gcc. When the script couldn't find a matching pattern, it would flag it for me to investigate. At least half of the time, the ones which didn't match my list of safe patterns were true bugs.

Likewise, in new code, the warnings were truly bad code at least half of the time.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds