KarypisLab/GKlib

gklib build failed with Clang 17.0.2

Opened this issue · 0 comments

Here is the error encountered by a user when installing gklib:arm64-android using vcpkg with clang 17.0.2:

error.c:205:10: error: call to undeclared function 'backtrace'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  size = backtrace(array, 10);
         ^
error.c:206:13: error: call to undeclared function 'backtrace_symbols'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
  strings = backtrace_symbols(array, size);
            ^
error.c:206:11: error: incompatible integer to pointer conversion assigning to 'char **' from 'int' [-Wint-conversion]
  strings = backtrace_symbols(array, size);
          ^ 

I think to solve this problem, it may be necessary to directly add #include <execinfo.h> in error.c file, or declare function using the extern keyword before its invocation:

extern int backtrace(void **buffer, int size);
extern char **backtrace_symbols(void *const *buffer, int size);