After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 654988 - g_atomic_int_add should document behaviour change
g_atomic_int_add should document behaviour change
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: docs
unspecified
Other All
: Normal minor
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2011-07-20 17:52 UTC by Simon McVittie
Modified: 2011-07-21 09:30 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Simon McVittie 2011-07-20 17:52:37 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
Comment 1 Matthias Clasen 2011-07-21 04:14:40 UTC
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.
Comment 2 Simon McVittie 2011-07-21 09:30:18 UTC
(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).