gcc-python-plugin icon indicating copy to clipboard operation
gcc-python-plugin copied to clipboard

FunctionDecl never finished

Open davidmalcolm opened this issue 8 years ago • 2 comments

Consider this plugin:

{{{ import gcc

def decl_finished(decl, *args, **kwargs): print "DECLARING %s -> %s" % (type(decl), decl.name)

gcc.register_callback(gcc.PLUGIN_FINISH_DECL, decl_finished) }}}

... and this C source file:

{{{ void somefunction(void) { } }}}

Running, I get:

{{{ pokyo. gcc-with-python2 simple-test-plugin.py -c somefunc.c DECLARING <type 'gcc.ParmDecl'> -> None }}}

First, it's weird to see a ParmDecl here - but ok, I can live with this :)

What the bug is really about is that I would expect a FunctionDecl to be finished here, but it is not. The docs say that it will be.

I did this on Fedora 21 using the system gcc and the system python plugin.

davidmalcolm avatar Feb 09 '17 20:02 davidmalcolm

Imported from trac issue 64. Created by tromey on 2015-05-20T11:13:25, last modified: 2015-11-23T11:22:21

davidmalcolm avatar Feb 09 '17 20:02 davidmalcolm

Trac comment by tromey on 2015-11-23 11:22:21:

FWIW still a problem on Fedora 22. I wonder now if this is a gcc bug, I will try to find out.

davidmalcolm avatar Feb 09 '17 20:02 davidmalcolm