gcc-python-plugin is a plugin for GCC 4.6 onwards which embeds the
CPython interpreter within GCC, allowing you to write new compiler
warnings in Python, generate code visualizations, etc.
It ships with "gcc-with-cpychecker", which implements static analysis
passes for GCC aimed at finding bugs in CPython extensions. In
particular, it can automatically detect reference-counting errors:
http://gcc-python-plugin.readthedocs.org/en/latest/cpychecker.html
What's new in 0.11?
===================
The main change in this release is support for compiling the plugin with
a C++ compiler. Recent versions of GCC 4.7 are now built with C++ rather
than C, meaning that plugins must also be built with C++ (since all of
GCC’s internal symbols are name-mangled). This release fixes the
plugin’s Makefile so that it autodetects whether the plugin needs to be
built with a C or C++ compiler and (I hope) does the right thing
automatically. I've also made the necessary changes to the C source code
of the plugin so that it is compilable as either language.
This should enable the plugin to now be usable with recent builds of gcc
4.7.* (along with gcc 4.6).
The plugin doesn't yet support gcc 4.8 prereleases (help would be
appreciated!)
For a description of the other improvements in 0.11, detailed release
notes can be seen at:
http://gcc-python-plugin.readthedocs.org/en/latest/0.11.html
Tarball releases are available at:
https://fedorahosted.org/releases/g/c/gcc-python-plugin/
Prebuilt-documentation can be seen at:
http://gcc-python-plugin.readthedocs.org/en/latest/index.html
The project's homepage is:
https://fedorahosted.org/gcc-python-plugin/
The plugin and checker are Free Software, licensed under the GPLv3 or
later.
Enjoy!
Dave Malcolm
Hi all,
Are there any plans to port this plugin to C++?[0] I haven't been able
to roll out the Gentoo ebuild for gcc-python-plugin-0.10 because my
GCC 4.7.[12] is built with C++ so there are plenty symbol mismatches.
David E. Narvaez
[0] https://lists.fedorahosted.org/pipermail/gcc-python-plugin/2012-April/00023…
Alek Paunov wrote:
> On 05.11.2012 10:36, Klaus Rudolph wrote:
>
> Check Build-time dependencies section in the docs or spec file:
>
> http://pkgs.fedoraproject.org/cgit/gcc-python-plugin.git/tree/gcc-python-pl…
>
I am wondering about:
# "six" is used at buildtime:
BuildRequires: python-six
BuildRequires: python3-six
because I could not get python-six for the ubuntu version. The info I
got was that six is outdated...
I could build with make without the python-six package.
>> Hard to find an entry point :-)
>
> insn_file is not an entry point - the plugin entry point is
> plugin_init in plugin.c
>
:-) I search an entry point for *me* to parse c++ files, not an entry
point of the compiler :-)
>
> If you are certain about your non packaged GCC on Ubuntu as
> development environment, I will have to install an Ubuntu VM here,
> but please provide me with instructions how to build this /opt GCC.
Yes, I am certain on my systems :-) I am not interested in installing a
complete new distro only for checking one library. And I believe that
missing only one symbol should not be a such big deal. But I think it is
to much work that you have to install a new distro only for fixing my
problems! It is not so important for me to get the things run and I
could check out another distro on my colleagues desktops in the next week.
My gcc was build with:
../configure --prefix=/opt/linux-gnu_4.7.2
--with-mpfr=/opt/linux-gnu_4.7.2 --with-mpc=/opt/linux-gnu_4.7.2
--with-ppl=/opt/linux-gnu_4.7.2 --with-gmp=/opt/linux-gnu_4.7.2
--enable-languages=c,c++
Thanks a lot for contribute your time for my problem!
Regards
Klaus
FYI: https://developer.mozilla.org/en-US/docs/Dehydra
-------- Original Message --------
Subject: Re: deydra compile problems
Date: Wed, 31 Oct 2012 10:31:43 -0700
From: Taras Glek <tglek(a)mozilla.com>
To: dev-static-analysis(a)lists.mozilla.org
On 10/31/2012 7:10 AM, Klaus Rudolph wrote:
> With actual dehydra sources I run into the following trouble:
> /opt/linux-gnu_4.7.2/bin/gcc -MD -g3 -Wall -fPIC -DXP_UNIX -DIN_GCC -DPLUGIN_NO_POISON -DHAVE_CONFIG_H -I/opt/linux-gnu_4.7.2/lib/gcc/i686-pc-linux-gnu/4.7.2/plugin/include -I../obj-js/dist/include/ -I/home/krud/work/dehydra/obj-js -I//home/krud/local/include/js/ -I/opt/linux-gnu_4.7.2/lib/gcc/i686-pc-linux-gnu/4.7.2/plugin/include/ -c dehydra_plugin.c
>
...
> Fails :-( with error listed on top of the mail.
>
> Any ideas?
Sorry you had to endure this. I just updated the wiki to indicate that
dehydra/treehydra are dead. See
https://developer.mozilla.org/en-US/docs/Dehydra. Try the python gcc
plugin instead.
Taras
_______________________________________________
dev-static-analysis mailing list
dev-static-analysis(a)lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-static-analysis