Open
Description
I tried building this on (Bookworm/Debian 12) which comes with gcc 12.2.0
cc -O2 -Werror -g -fPIC -fno-strict-aliasing -Wall -I/usr/lib/gcc/aarch64-linux-gnu/12/plugin/include -I/usr/lib/gcc/aarch64-linux-gnu/12/plugin/include/c-family -I. -c -x c++ -fno-rtti -o gcc-declaration.o -I./ gcc-declaration.c
gcc-declaration.c: In function 'bool gcc_decl_is_builtin(gcc_decl)':
gcc-declaration.c:44:10: error: 'DECL_IS_BUILTIN' was not declared in this scope; did you mean 'DEF_LIB_BUILTIN'?
44 | return DECL_IS_BUILTIN (decl.inner);
| ^~~~~~~~~~~~~~~
| DEF_LIB_BUILTIN
make: *** [Makefile:98: gcc-declaration.o] Error 1
Looking around it looks like gcc10 changed the macros and a new feature __has_builtin replaces the 'DECL_IS_BUILTIN' macro:
The special operator __has_builtin (operand) may be used in constant integer contexts and in preprocessor ?#if? and ?#elif? expressions to test whether the symbol named by its operand is recognised as a built-in function by GCC in the current language and conformance mode.
Unfortunately just replacing
return DEC_IS_BUILTIN (decl.inner);
with
return __has_builtin (decl.inner);
fails to deal with dec.inner, and there I am a bit stuck.
Thanks for looking
Keith
Metadata
Metadata
Assignees
Labels
No labels