Skip to content

BLD: fix build warning about backtrace implicit definition #22613

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

rgommers
Copy link
Member

The exact warning was:

[1/3] Compiling C object numpy/core/_multi...nux-gnu.so.p/src_multiarray_temp_elide.c.o
../numpy/core/src/multiarray/temp_elide.c: In function 'check_callers':
../numpy/core/src/multiarray/temp_elide.c:154:13: warning: implicit declaration of function 'backtrace' [-Wimplicit-function-declaration]
  154 |     nptrs = backtrace(buffer, NPY_MAX_STACKSIZE);
      |             ^~~~~~~~~

The exact warning was:

```
[1/3] Compiling C object numpy/core/_multi...nux-gnu.so.p/src_multiarray_temp_elide.c.o
../numpy/core/src/multiarray/temp_elide.c: In function 'check_callers':
../numpy/core/src/multiarray/temp_elide.c:154:13: warning: implicit declaration of function 'backtrace' [-Wimplicit-function-declaration]
  154 |     nptrs = backtrace(buffer, NPY_MAX_STACKSIZE);
      |             ^~~~~~~~~
```
@rgommers
Copy link
Member Author

Hmm, re-running CI. The Emscripten failure seemed like a connection issue, the AVX512 failure looked real though.

@@ -7,6 +7,10 @@
#include "npy_config.h"
#include "numpy/arrayobject.h"

#if defined HAVE_BACKTRACE
#include <execinfo.h>
#endif
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In other places, we use:

#if defined HAVE_EXECINFO_H
#include <execinfo.h>
#elif defined HAVE_LIBUNWIND_H
#include <libunwind.h>
#endif

See gh-22152. That might be what is needed for Emscripten (or at least for something else).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah yes, thanks!

@rgommers
Copy link
Member Author

Overlooked something, I'll close this for now - the code may be fine and the hiccup in my new config.h generation.

@rgommers rgommers closed this Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants