[glib: 1/3] glist: Mention -Wcast-function-type problems with g_*list_copy_deep()



commit e81f4c2acea5ada6ae989426e462613f7c612cac
Author: Philip Withnall <withnall endlessm com>
Date:   Mon Aug 20 11:00:29 2018 +0100

    glist: Mention -Wcast-function-type problems with g_*list_copy_deep()
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    https://gitlab.gnome.org/GNOME/glib/issues/1492

 glib/glist.c  | 6 ++++--
 glib/gslist.c | 8 +++++---
 2 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/glib/glist.c b/glib/glist.c
index 6f2079a4c..51adeb058 100644
--- a/glib/glist.c
+++ b/glib/glist.c
@@ -649,8 +649,10 @@ g_list_copy (GList *list)
  * container itself.
  *
  * @func, as a #GCopyFunc, takes two arguments, the data to be copied
- * and a @user_data pointer. It's safe to pass %NULL as user_data,
- * if the copy function takes only one argument.
+ * and a @user_data pointer. On common processor architectures, it's safe to
+ * pass %NULL as @user_data if the copy function takes only one argument. You
+ * may get compiler warnings from this though if compiling with GCC’s
+ * `-Wcast-function-type` warning.
  *
  * For instance, if @list holds a list of GObjects, you can do:
  * |[<!-- language="C" -->   
diff --git a/glib/gslist.c b/glib/gslist.c
index 7a24fb66d..51bd51f0c 100644
--- a/glib/gslist.c
+++ b/glib/gslist.c
@@ -557,9 +557,11 @@ g_slist_copy (GSList *list)
  * In contrast with g_slist_copy(), this function uses @func to make a copy of
  * each list element, in addition to copying the list container itself.
  *
- * @func, as a #GCopyFunc, takes two arguments, the data to be copied and a user
- * pointer. It's safe to pass #NULL as user_data, if the copy function takes only
- * one argument.
+ * @func, as a #GCopyFunc, takes two arguments, the data to be copied
+ * and a @user_data pointer. On common processor architectures, it's safe to
+ * pass %NULL as @user_data if the copy function takes only one argument. You
+ * may get compiler warnings from this though if compiling with GCC’s
+ * `-Wcast-function-type` warning.
  *
  * For instance, if @list holds a list of GObjects, you can do:
  * |[<!-- language="C" --> 


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