Static code analysis follow ups

Basile Starynkevitch basile@starynkevitch.net
Fri Dec 30 14:34:00 GMT 2011


On Fri, 30 Dec 2011 15:15:40 +0100
"sarah@hederstierna.com" <fredrik@hederstierna.com> wrote:

> Hi!
> 
> I'm currently looking into possibilities to improve GCC for static-code-analysis features.
> Some weeks ago I proposed re-introducing -Wunreachable-code for finding dead code:
> 
>   http://gcc.gnu.org/ml/gcc-patches/2011-12/msg00385.html
> 
> (The warning was removed in http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00251.html)
> 
> Though I have not got any reply yet, the patch might be wrong, but possibly the remove_bb() call
> could have some kind of 'reason' parameter to avoid false positives?
> 
> Also I last year sent out ideas about static code analysis in:
> 
>   http://gcc.gnu.org/ml/gcc/2011-02/msg00227.html
> 

Several GCC plugins are providing some static code analysis, and my perception is that
GCC plugins are a good way of implementing them (in particular, because static analysis
is often costly, and very often somehow specific). MELT http://gcc-melt.org/ is a way of
extending GCC (since it is a domain specific language for that), and Pierre Vittet spent a
successful Google Summer of Code to implement Talpo using MELT: http://gitorious.org/talpo
Talpo is doing some static analysis, e.g. to detect that fopen is tested, etc.

Regards.
-- 
Basile STARYNKEVITCH         http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mine, sont seulement les miennes} ***



More information about the Gcc mailing list