mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-20 07:38:54 +02:00
Bug 585584: Fix warnings in girparser backtrace functionality and compiler.c
This commit is contained in:
@@ -29,6 +29,10 @@
|
|||||||
#include "gtypelib.h"
|
#include "gtypelib.h"
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
|
#if defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS)
|
||||||
|
# include <execinfo.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
struct _GIrParser
|
struct _GIrParser
|
||||||
{
|
{
|
||||||
gchar **includes;
|
gchar **includes;
|
||||||
@@ -276,9 +280,8 @@ backtrace_stderr (void)
|
|||||||
{
|
{
|
||||||
#if defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS)
|
#if defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS)
|
||||||
void *array[50];
|
void *array[50];
|
||||||
int size;
|
int size, i;
|
||||||
char **strings;
|
char **strings;
|
||||||
size_t i;
|
|
||||||
|
|
||||||
size = backtrace (array, 50);
|
size = backtrace (array, 50);
|
||||||
strings = (char**) backtrace_symbols (array, size);
|
strings = (char**) backtrace_symbols (array, size);
|
||||||
@@ -288,7 +291,7 @@ backtrace_stderr (void)
|
|||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
fprintf (stderr, "%s\n", strings[i]);
|
fprintf (stderr, "%s\n", strings[i]);
|
||||||
|
|
||||||
fprintf (stderr, "--- END BACKTRACE ---\n", size);
|
fprintf (stderr, "--- END BACKTRACE ---\n");
|
||||||
|
|
||||||
free (strings);
|
free (strings);
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user