Skip to content

gklib build failed with Clang 17.0.2 #35

@Cheney-W

Description

@Cheney-W

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions