davidmalcolm / gcc-python-plugin

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

Errors: functions not declared in this scope #112

Closed davidedelvento closed 6 years ago

davidedelvento commented 7 years ago

Compiling trunk (commit 257ad364a2d61d6289231ff65c3795656cf6dc27) with gcc v6.3.0 fails with

gcc-location.c: In function ‘gcc_location gcc_location_get_caret(gcc_location)’:
gcc-location.c:68:65: error: ‘get_pure_location’ was not declared in this scope
   return gcc_private_make_location (get_pure_location (loc.inner));
                                                                 ^
gcc-location.c: In function ‘gcc_location gcc_location_get_start(gcc_location)’:
gcc-location.c:74:57: error: ‘get_start’ was not declared in this scope
   return gcc_private_make_location (get_start (loc.inner));
                                                         ^
gcc-location.c: In function ‘gcc_location gcc_location_get_finish(gcc_location)’:
gcc-location.c:80:58: error: ‘get_finish’ was not declared in this scope
   return gcc_private_make_location (get_finish (loc.inner));

Release v0.15 works fine (need to nose @afanfa)

davidmalcolm commented 6 years ago

These functions are declared in gcc's input.h, as of gcc 6 onwards, I think. Is that file missing a #include, or does you input.h not have them, maybe?

davidmalcolm commented 6 years ago

Aha: looking at the gcc 6 branch, looks like input.h on that branch never got those functions: https://gcc.gnu.org/git/?p=gcc.git;a=blob;f=gcc/input.h;h=97c43332ee751d4187acf6fae4490eac2c4dbe7b;hb=4b5e15daff8b54440e3fda451c318ad31e532fab

Sorry about that. The plugin's gcc-location.c needs to handle their absence.

davidmalcolm commented 6 years ago

Hopefully fixed by https://github.com/davidmalcolm/gcc-python-plugin/pull/114.

davidmalcolm commented 6 years ago

Should be fixed now.