GNOME Bugzilla – Bug 654988
g_atomic_int_add should document behaviour change
Last modified: 2011-07-21 09:30:18 UTC
g_atomic_int_add now returns a value, which it didn't previously, making the "Since: 2.4" annotation misleading. Code using this function is only backwards-compatible to older GLib if it doesn't use the returned value. Suggested patch: diff --git a/glib/gatomic.c b/glib/gatomic.c index 495d090..328ad4f 100644 --- a/glib/gatomic.c +++ b/glib/gatomic.c @@ -206,6 +206,9 @@ gboolean * * This call acts as a full compiler and hardware memory barrier. * + * Before version 2.30, this function did not return a value + * (but g_atomic_int_exchange_and_add() did, and had the same meaning). + * * Returns: the value of @atomic before the add, signed * * Since: 2.4
Sure, thats fine to add. We've generally been lenient when adding return values to functions that did not previously have them. Feel free to commit.
(In reply to comment #1) > Sure, thats fine to add. We've generally been lenient when adding return values > to functions that did not previously have them. Committed, thanks. It's a compatible change, so it's fine to make, but please mention it in documentation when it happens (for the same reasons that "Since" is a good idea).