Skip to content

Commit e79c688

Browse files
committed
host: silence warns if libbacktrace not present
1 parent 877ba7a commit e79c688

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/host.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,6 @@
6262

6363
#ifdef HAVE_LIBBACKTRACE
6464
#include <backtrace.h>
65-
#else
66-
struct backtrace_state {};
6765
#endif
6866

6967
#include <algorithm> // for max
@@ -195,8 +193,6 @@ void *mainloop_udata;
195193
extern "C" int _fltused = 0;
196194
#endif
197195

198-
static struct backtrace_state *bt;
199-
200196
struct init_data {
201197
bool com_initialized = false;
202198
list <void *> opened_libs;
@@ -437,6 +433,8 @@ static void echeck_unexpected_exit(void ) {
437433
}
438434

439435
#ifdef HAVE_LIBBACKTRACE
436+
static struct backtrace_state *bt;
437+
440438
static void
441439
libbt_error_callback(void *data, const char *msg, int errnum)
442440
{
@@ -1370,6 +1368,8 @@ print_stacktrace_glibc()
13701368
libbt_error_callback, &fd);
13711369
}
13721370
st_glibc_flush_output(fd, last_pos);
1371+
#else
1372+
(void) last_pos;
13731373
#endif
13741374

13751375
if (fd != STDERR_FILENO) {

0 commit comments

Comments
 (0)