validate: fix build warning in generate_unwind_trace()

The unw_word_t type has different sizes for 32-bit and 64-bit, so using the
%lx format specifier on a 32-bit CPU leads to the following compile warning:

  CC       libgstvalidate_1.0_la-gst-validate-report.lo
gst-validate-report.c: In function 'generate_unwind_trace':
gst-validate-report.c:137:36: error: format '%lx' expects argument of type 'long unsigned int', but argument 4 has type 'unw_word_t {aka unsigned int}' [-Werror=format=]
     g_string_append_printf (trace, "%s (0x%lx)\n", name, offset);

Cast to long so the %lx fomart specifier can be always used.
This commit is contained in:
Javier Martinez Canillas 2016-09-22 11:37:57 -04:00 committed by Thibault Saunier
parent 6c37fa7110
commit 6110ecdc9b

View file

@ -134,7 +134,7 @@ generate_unwind_trace (void)
unw_word_t offset;
unw_get_proc_name (&cursor, name, sizeof (name), &offset);
g_string_append_printf (trace, "%s (0x%lx)\n", name, offset);
g_string_append_printf (trace, "%s (0x%lx)\n", name, (long) offset);
#endif
}