GNOME Bugzilla – Bug 756065
audioaggregator: fix build error
Last modified: 2015-10-07 18:06:05 UTC
Build error due to wrong argument type in debug message gstaudioaggregator.c:1142:5: error: format '%lu' expects argument of type 'long unsigned int', but argument 8 has type 'gint64' [-Werror=format=] GST_DEBUG_OBJECT (aagg, "Starting at offset %lu", aagg->priv->offset);
Created attachment 312654 [details] [review] fix build error
Review of attachment 312654 [details] [review]: ::: gst/audiomixer/gstaudioaggregator.c @@ +1141,3 @@ GST_SECOND); + GST_DEBUG_OBJECT (aagg, "Starting at offset %" G_GUINT64_FORMAT, + aagg->priv->offset); Offset is a gint64, you are using the guint64 formatter here.
Actually, there seems to quite a lot of mismatch for gint64 and guint64 in audioaggregator.. guint64 output_offset; guint64 next_offset; these two are declared as unsigned.. But it is being assigned pad->priv->output_offset = -1; pad->priv->next_offset = -1; at a lot of places.. Should all the offset values be changed to signed int64?
but buffer offset is uint64 -- GST_BUFFER_OFFSET() And we are assigning signed values to unsigned value GST_BUFFER_OFFSET (outbuf) = aagg->priv->offset; Probably we should maintain some consistency? guess uint64 everywhere? :)
I was just commenting on the correctness of your patch, but if you feel like cleaning this up that would be nice. In general guint64 shall be used, unless we hold a delta that can be negative. Just like for timestamp, -1 assigned to a guint64 is a lazy way to obtain G_MAXUINT64. An example is the timestamp: #define GST_CLOCK_TIME_NONE ((GstClockTime) -1)
Use G_GINT64_FORMAT here, the -1 assignments are correct as Nicolas says.
Thanks for the clarification.. Actually in the same function there is another log where guint64 format is being used for offset(int64 variable).. And 3-4 other places in the file.. I wont hv access to system to make changes till Wednesday.. So please feel free to commit a new patch making the changes ... sorry about that :)
No problem, we can wait for you :) What compiler/platform is that btw, it doesn't cause any warnings here.
Created attachment 312774 [details] [review] fix build error Along with build error, change from uint64 formatter to int64 formatter for int64 variables
by the way, i am using gst un-installed setup in ubuntu 14.04 32 bit machine
commit 3b89dd4768c15e31a80a815d16f0899abf8818ad Author: Vineeth TM <vineeth.tm@samsung.com> Date: Wed Oct 7 08:48:15 2015 +0900 audioaggregator: Fix build error Build error due to wrong argument type in debug message aagg->priv->offset and next_offset are of type int64, but uint64 formatter is being used in logs. Changing all those to int64 https://bugzilla.gnome.org/show_bug.cgi?id=756065