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 793073 - netsim: build failure due to printf format warnings on 32-bit platforms
netsim: build failure due to printf format warnings on 32-bit platforms
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
git master
Other Linux
: Normal normal
: 1.13.1
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2018-01-31 17:41 UTC by Omar Akkila
Modified: 2018-02-01 11:12 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
netsim: fix format errors for different platforms (2.15 KB, patch)
2018-01-31 18:45 UTC, Omar Akkila
committed Details | Review

Description Omar Akkila 2018-01-31 17:41:22 UTC
When cross-compiling -bad for armv7 (32-bit) I get the following errors:

gstnetsim.c: In function ‘gst_net_sim_delay_buffer’:
gstnetsim.c:372:31: error: format ‘%ld’ expects argument of type ‘long int’, but argument 8 has type ‘gint64 {aka long long int}’ [-Werror=format=]
     GST_DEBUG_OBJECT (netsim, "Delaying packet by %ldms",
                               ^
         (ready_time - now_time) / 1000);
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~

gstnetsim.c: In function ‘gst_net_sim_token_bucket’:
gstnetsim.c:449:27: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘gsize {aka unsigned int}’ [-Werror=format=]
   GST_LOG_OBJECT (netsim, "Adding %d tokens to bucket (contains %lu tokens)",
                           ^
       tokens, netsim->bucket_size);
               ~~~~~~~~~    
                               ^
gstnetsim.c:457:31: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘gsize {aka unsigned int}’ [-Werror=format=]
     GST_DEBUG_OBJECT (netsim, "Buffer size (%lu) exeedes bucket size (%lu)",
                               ^
         buffer_size, netsim->bucket_size);

gstnetsim.c:463:27: error: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 9 has type ‘gsize {aka unsigned int}’ [-Werror=format=]
   GST_LOG_OBJECT (netsim, "Buffer taking %lu tokens (%lu left)",
                           ^
       buffer_size, netsim->bucket_size);


These regressions were introduced by commits 3f87a9dd7f (bz: https://bugzilla.gnome.org/show_bug.cgi?id=791838) and 3eb733d95f (no bz link).

For `gst_net_sim_delay_buffer` replacing %lu with " G_GSIZE_FORMAT " would hopefully fix it.  Similarly with `gst_net_sim_delay_buffer` by replacing %ld with " G_GINT64_FORMAT ".
Comment 1 Omar Akkila 2018-01-31 18:45:29 UTC
Created attachment 367729 [details] [review]
netsim: fix format errors for different platforms
Comment 2 Tim-Philipp Müller 2018-02-01 11:11:33 UTC
Comment on attachment 367729 [details] [review]
netsim: fix format errors for different platforms

Pushed, thanks for the patch!

commit c365ab7e667860ec654ebe94ed043be7233f3b63
Author: Omar Akkila <omar.akkila@collabora.co.uk>
Date:   Wed Jan 31 13:21:58 2018 -0500

    netsim: fix format errors for different platforms
    
    https://bugzilla.gnome.org/show_bug.cgi?id=793073