GNOME Bugzilla – Bug 793073
netsim: build failure due to printf format warnings on 32-bit platforms
Last modified: 2018-02-01 11:12:28 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 ".
Created attachment 367729 [details] [review] netsim: fix format errors for different platforms
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