GNOME Bugzilla – Bug 650200
Fix symbols being reported in invalid files.
Last modified: 2015-02-07 16:49:42 UTC
Due to the way that flex/bison works, the symbols are not added to the scanner immediately. Additional lines can be parsed through bison, after a symbol is parsed but before its added to the scanner. If these lines are #line directives, then scanner->current_filename can change between when the symbol is parsed and when it's added. Change so that symbol gets filename when parsing rather than when being added to the scanner.
Created attachment 187825 [details] [review] Patch for review The branch this patch is based on is here: http://cgit.collabora.co.uk/git/user/stefw/gobject-introspection.git/log/?h=correct-macro-source-file
BTW, this caused other problems. I'm trying to add introspection to libgcr (in gnome-keyring) and various #define symbols from C files were showing up as warning messages: gcr-importer.h:117: Warning: Gcr: symbol='BLOCK': Unknown namespace for symbol 'BLOCK' The symbol is actually on line 117 of gcr-importer.c [1]. Since g-ir-scanner uses the suffix (.c vs .h) to determine whether a symbol is public, the filename affects more than just cosmetic output. [1] http://git.gnome.org/browse/gnome-keyring/tree/gcr/gcr-importer.c#n117
Created attachment 190019 [details] [review] Updated patch rebased on master. Branch here: http://cgit.collabora.com/git/user/stefw/gobject-introspection.git/log/?h=correct-macro-source-file
*** This bug has been marked as a duplicate of bug 629757 ***
[Mass-moving gobject-introspection tickets to its own Bugzilla product - see bug 708029. Mass-filter your bugmail for this message: introspection20150207 ]