[cfe-dev] GSoC - Static Analyzer project ideas?

Joerg Sonnenberger joerg at britannica.bec.de
Wed Mar 23 05:20:25 PDT 2011


On Mon, Mar 21, 2011 at 01:05:16PM +0100, Martin Milata wrote:
> The analyzer is not mentioned on the open projects page, so my question
> is if anybody has some project idea and/or is willing to mentor it?

Let me hijack this a bit and see if I can offload some long term work :)

NetBSD has a semi-maintained implementation of lint. One of the
things that would be nice for us (NetBSD) is if it could be fully
replaced by the static analyzer of clang.

I don't have an exhaustive lists of check lint does and clang doesn't,
but there is at least one major set of functions missing. The static
analyzer is currently operating strictly on a per file base. It can't do
inter-file (or even inter-library) consistency checks of type or
function definitions.

This means checking if function prototypes have compatible argument
lists in all files. Types are either only used locally or are equivalent
across the project etc.

It could be further extended to provide an ABI compatibility checker.
Consider you are maintaining a larger library and you are in the process
of preparing a new release. Is the new version ABI compatible with the
old release? If it isn't, you have to either fix that or bump major
versions etc. I'm not aware of any program in this area and it is a
major hassle to do it correctly. Many, many programmers don't get this
right, so having an automated tool would be a huge improvement.

Just to give you some ideas for what could be done.

Joerg



More information about the cfe-dev mailing list