davidmalcolm / gcc-python-plugin

GCC plugin that embeds CPython inside the compiler
GNU General Public License v3.0
197 stars 58 forks source link

Lots of exceptions from cpychecker #84

Open davidmalcolm opened 7 years ago

davidmalcolm commented 7 years ago

Having seen David Malcolm's awesome PyCon talk, I thought I'd give cpychecker a try on my own code.

I'm on Fedora 18, and installed all the dependencies from packages.

I checked out gcc-python-plugin from here: http://git.fedorahosted.org/cgit/gcc-python-plugin.git/ and got hash 537bbc998064 as the current master.

Did make plugin and all seemed to build. make demo gives:

{{{ Makefile:188: warning: overriding recipe for target autogenerated-casts.c' Makefile:185: warning: ignoring old recipe for targetautogenerated-casts.c' LD_LIBRARY_PATH=gcc-c-api ./gcc-with-cpychecker -c -I/usr/include/python2.7 -I/usr/include/python2.7 demo.c demo.c:1:1: error: invalid flag "WITH_CPYCHECKER_RETURNS_BORROWED_REF_ATTRIBUTE" in line directive demo.c:1:48: warning: extra tokens at end of ## directive [enabled by default] /usr/include/stdio.h:34: confused by earlier errors, bailing out Preprocessed source stored into /tmp/ccfhbjIE.out file, please attach this to your bugreport. make: *** [demo] Error 1 }}}

Went to try to run this on a project of mine, astropy, available from http://github.com/astropy/astropy.

I compiled it with

{{{ CC=/home/mdboom/Work/builds/gcc-python-plugin/gcc-with-cpychecker python setup.py build }}}

Among what seem to be some legitimate problems it's finding in my code (hooray!), it has some unhandled exceptions that cause the compiler to fail and building halts. I would have expected building to continue if the C code is at least compilable (which it is with the vanilla gcc compiler).

davidmalcolm commented 7 years ago

Imported from trac issue 44. Created by mdboom on 2013-03-22T10:00:00, last modified: 2014-05-21T10:34:47

davidmalcolm commented 7 years ago

Trac comment by dmalcolm on 2014-05-21 10:34:47:

Sorry for not seeing this earlier.

The above is usually an issue with ccache (see ticket #41). Try disabling ccache; e.g. by setting: {{{ CCACHE_DISABLE=1 }}} in the environment