GNOME Bugzilla – Bug 760762
tracer: Fix compiler warnings on 32-bit systems
Last modified: 2016-01-18 11:33:09 UTC
thread_id is casted to guint64, which is throwing build error. Changing it to guint The errors are gstrusage.c: In function 'do_stats': gstrusage.c:241:37: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] gst_tracer_record_log (tr_thread, (guint64)thread_id, ts, gst-stats.c: In function ‘new_pad_stats’: gst-stats.c:162:22: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] stats->thread_id = (gpointer) thread_id; ^ gst-stats.c: In function ‘do_thread_rusage_stats’: gst-stats.c:395:36: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast] thread_stats = get_thread_stats ((gpointer) thread_id);
Created attachment 319234 [details] [review] fix build error proposed patch. Please feel free to add a different patch if there is a better way to fix this.
Created attachment 319235 [details] [review] tracers: fix thread-id casts to 64-bit ints on 32-bit systems Does this fix it as well?
yep this fixes it as well..
Pushed my solution then, because yours is not going to work right on 64-bit systems: commit 8641d7c9113e23a60d2472f1434c28de3a608f23 Author: Tim-Philipp Müller <tim@centricular.com> Date: Sun Jan 17 23:49:27 2016 +0000 tracers: fix thread-id casts to 64-bit ints on 32-bit systems https://bugzilla.gnome.org/show_bug.cgi?id=760762 It's not very nice though, perhaps we should make the trace logger handle GST_TYPE_THREAD as well and then serialise the pointer to a uint64 internally? Or the logger just always logs the thread ID automatically just like we do with GST_LOG.