[gstreamer-bugs] [Bug 611692] Add more warning flags

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Sun Mar 7 06:53:48 PST 2010


https://bugzilla.gnome.org/show_bug.cgi?id=611692
  GStreamer | gstreamer (core) | git

--- Comment #31 from Benjamin Otte (Company) <otte at gnome.org> 2010-03-07 14:53:47 UTC ---
(In reply to comment #25)
> Review of attachment 155116 [details]:
> 
> I'm not impressed by all the casting that needs to be done to make signed and
> unsigned compares work with -Wsigned-compare.  IMO, this makes the code much
> more prone to errors.
>
There's in general 2 sources of errors for the required casting:
1) offsets versus differences in offsets (byte or time). It's the same bad
thing as size_t vs ssize_t. I'm not aware of a way to properly handle that, but
it requires particular care so enabling warnings for this makes sense I think.
We can get around the casts if we use explicit assignments instead when we want
to interpret a diff as an absolute position (like I did with real_offset
variable in the typefind helper).

2) Bad API design. I think all the places I've found marked this as FIXME 0.11
already, but it's unfortunately not something I can fix today, so I have to do
the casts. It's especially bad if it's out variables to function calls.
Another big contributor also is the fact that we mark invalid timestamps or
offsets as "(guint64) -1". We have GST_CLOCK_TIME_NONE/GST_CLOCK_TIME_IS_VALID
to hide this for timestamps, but offsets only have GST_BUFFER_OFFSET_NONE. A
IS_VALID() macro is missing here and the BUFFER_OFFSET_NONE name discourages
use to me for anything but buffers.

-- 
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.




More information about the Gstreamer-bugs mailing list