[gstreamer-bugs] [Bug 623003] Major problems with calls to gst_util_uint64_scale()

GStreamer (bugzilla.gnome.org) bugzilla at gnome.org
Mon Jun 28 01:18:04 PDT 2010


https://bugzilla.gnome.org/show_bug.cgi?id=623003
  GStreamer | gst-plugins-base | git

--- Comment #6 from Sebastian Dröge <slomo at circular-chaos.org> 2010-06-28 08:18:02 UTC ---
Not marking gst_util_uint64_scale() as G_GNUC_CONST fixes this. The problem is,
that these functions are not really const when using the C int128
implementation. Reason is, that they call functions that are not const because
they have pointer arguments and change/examine these pointer arguments.

The docs explicitly say this:

Expands to the GNU C const function attribute if the compiler is gcc. Declaring
a function as const enables better optimization of calls to the function. A
const function doesn't examine any values except its parameters, and has no
effects except its return value. See the GNU C documentation for details.

Note
A function that has pointer arguments and examines the data pointed to must not
be declared const. Likewise, a function that calls a non-const function usually
must not be const. It doesn't make sense for a const function to return void.


Not sure if we can mark the function as G_GNUC_PURE, probably not because the
functions have other effects than the return values.

Patch follows

-- 
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