[glib: 1/2] gmem: Clarify calling convention behaviour of g_clear_pointer() in docs



commit 965bc6d857576c7858c552c1c7182de86ca5849b
Author: Philip Withnall <withnall endlessm com>
Date:   Wed Aug 22 10:28:47 2018 +0100

    gmem: Clarify calling convention behaviour of g_clear_pointer() in docs
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://gitlab.gnome.org/GNOME/glib/issues/1494

 glib/gmem.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/glib/gmem.c b/glib/gmem.c
index c4f42c545..b72a58335 100644
--- a/glib/gmem.c
+++ b/glib/gmem.c
@@ -210,7 +210,11 @@ g_free (gpointer mem)
  * pointer is set to %NULL.
  *
  * A macro is also included that allows this function to be used without
- * pointer casts.
+ * pointer casts. This will mask any warnings about incompatible function types
+ * or calling conventions, so you must ensure that your @destroy function is
+ * compatible with being called as `GDestroyNotify` using the standard calling
+ * convention for the platform that GLib was compiled for; otherwise the program
+ * will experience undefined behaviour.
  *
  * Since: 2.34
  **/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]