From 6110ecdc9be917282d404f7a8082d8b2e5868c36 Mon Sep 17 00:00:00 2001 From: Javier Martinez Canillas Date: Thu, 22 Sep 2016 11:37:57 -0400 Subject: [PATCH] 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. --- validate/gst/validate/gst-validate-report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/validate/gst/validate/gst-validate-report.c b/validate/gst/validate/gst-validate-report.c index ca0933573b..f01a0d795c 100644 --- a/validate/gst/validate/gst-validate-report.c +++ b/validate/gst/validate/gst-validate-report.c @@ -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 }