clang static analysis

"James K. Lowden" <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
http://www.freetds.org/scan-build/

The above analysis was produced by the Clang "static-build" tool based
on a recent version of the development branch.  A spot-check shows
several false positives but some bona fide errors e.g.

http://www.freetds.org/scan-build/report-06549p.html#EndPath

There are 206 potential errors indicated.  If you would like to
contribute to the project, it would be very helpful simply to sort
those 206 into two kinds:

1.  errors
2.  non-errors

If several people do this, we will have good feedback for both the
FreeTDS and Clang projects.  In the case of Clang, perhaps we can
classify the non-errors.  For instance, I noticed that variables
initialized as a function output parameter isn't recognized as
initialization, and a pointer is detected as NULL after being tested
with assert(3) (although arguably the assert is insufficient).  

Patches are also welcome, of course.  :-)

FreeTDS is an interesting test case for the Clang static analyzer
by virtue of its portability.  Recent AIX issues notwithstanding,
FreeTDS is highly portable and conscientious about standards.  The
project has tens of thousands of users, and has held stable at ~100,000
lines of code for several years.  Yet static analysis continues to turn
up potential errors.  

--jkl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.