After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 760762 - tracer: Fix compiler warnings on 32-bit systems
tracer: Fix compiler warnings on 32-bit systems
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal normal
: 1.7.2
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2016-01-17 23:27 UTC by Vineeth
Modified: 2016-01-18 11:33 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
fix build error (5.08 KB, patch)
2016-01-17 23:29 UTC, Vineeth
none Details | Review
tracers: fix thread-id casts to 64-bit ints on 32-bit systems (5.87 KB, patch)
2016-01-17 23:52 UTC, Tim-Philipp Müller
committed Details | Review

Description Vineeth 2016-01-17 23:27:54 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);
Comment 1 Vineeth 2016-01-17 23:29:42 UTC
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.
Comment 2 Tim-Philipp Müller 2016-01-17 23:52:17 UTC
Created attachment 319235 [details] [review]
tracers: fix thread-id casts to 64-bit ints on 32-bit systems

Does this fix it as well?
Comment 3 Vineeth 2016-01-17 23:56:37 UTC
yep this fixes it as well..
Comment 4 Tim-Philipp Müller 2016-01-18 11:32:46 UTC
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.