[patch] glib -- just call me the human -Werror



I compiled glib HEAD and ran into warnings, which I fixed except for the one that seems due to an error in gcc's handling of printf format strings with positional parameters in them. There are a few important ones -- those local variables named len will create a bit of trouble, and I think they should have caused some tests to fail.

Should I commit? Seems not worth attaching this to a bug report.

Index: .cvsignore
===================================================================
RCS file: /cvs/gnome/glib/.cvsignore,v
retrieving revision 1.20
diff -p -u -r1.20 .cvsignore
--- .cvsignore	2001/06/26 16:00:30	1.20
+++ .cvsignore	2001/07/11 00:37:54
@@ -36,3 +36,4 @@ gthread-2.0-uninstalled.pc
 gobject-2.0-uninstalled.pc
 glib-config-2.0
 .saved
+sgml
Index: glib/gmain.c
===================================================================
RCS file: /cvs/gnome/glib/glib/gmain.c,v
retrieving revision 1.62
diff -p -u -r1.62 gmain.c
--- glib/gmain.c	2001/06/30 20:06:16	1.62
+++ glib/gmain.c	2001/07/11 00:38:00
@@ -2174,7 +2174,7 @@ g_main_context_iterate (GMainContext *co
     }
   else
     LOCK_CONTEXT (context);
-#endif G_THREADS_ENABLED
+#endif /* G_THREADS_ENABLED */

   if (!context->cached_poll_array)
     {
Index: glib/gunicollate.c
===================================================================
RCS file: /cvs/gnome/glib/glib/gunicollate.c,v
retrieving revision 1.2
diff -p -u -r1.2 gunicollate.c
--- glib/gunicollate.c	2001/07/07 02:42:47	1.2
+++ glib/gunicollate.c	2001/07/11 00:38:01
@@ -165,7 +165,6 @@ g_utf8_collate_key (const gchar *str,
 		    gssize       len)
 {
   gchar *result;
-  size_t len;

 #ifdef __STDC_ISO_10646__

Index: glib/guniprop.c
===================================================================
RCS file: /cvs/gnome/glib/glib/guniprop.c,v
retrieving revision 1.9
diff -p -u -r1.9 guniprop.c
--- glib/guniprop.c	2001/07/07 02:42:47	1.9
+++ glib/guniprop.c	2001/07/11 00:38:02
@@ -711,7 +711,6 @@ gchar *
 g_utf8_strup (const gchar *str,
 	      gssize       len)
 {
-  gsize len;
   LocaleType locale_type;
   gchar *result;

@@ -827,7 +826,6 @@ gchar *
 g_utf8_strdown (const gchar *str,
 		gssize       len)
 {
-  gsize len;
   LocaleType locale_type;
   gchar *result;

Index: gmodule/gmodule.c
===================================================================
RCS file: /cvs/gnome/glib/gmodule/gmodule.c,v
retrieving revision 1.38
diff -p -u -r1.38 gmodule.c
--- gmodule/gmodule.c	2001/06/23 13:55:08	1.38
+++ gmodule/gmodule.c	2001/07/11 00:38:02
@@ -124,7 +124,7 @@ g_module_find_by_name (const gchar *name
 }

 static inline void
-g_module_set_error_unduped (const gchar *error)
+g_module_set_error_unduped (gchar *error)
 {
   g_static_private_set (&module_error_private, error, g_free);
   errno = 0;
Index: gobject/gsignal.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/gsignal.c,v
retrieving revision 1.35
diff -p -u -r1.35 gsignal.c
--- gobject/gsignal.c	2001/06/28 17:05:12	1.35
+++ gobject/gsignal.c	2001/07/11 00:38:04
@@ -1736,7 +1736,9 @@ g_signal_emitv (const GValue *instance_a
   const GValue *param_values;
   gpointer instance;
   SignalNode *node;
+#ifndef G_DISABLE_ASSERT
   guint i;
+#endif

   g_return_if_fail (instance_and_params != NULL);
   instance = g_value_peek_pointer (instance_and_params);
Index: gobject/gtype.c
===================================================================
RCS file: /cvs/gnome/glib/gobject/gtype.c,v
retrieving revision 1.30
diff -p -u -r1.30 gtype.c
--- gobject/gtype.c	2001/06/29 02:50:46	1.30
+++ gobject/gtype.c	2001/07/11 00:38:06
@@ -1391,7 +1391,9 @@ static void
 type_iface_vtable_init_Wm (TypeNode *iface,
 			   TypeNode *node)
 {
+#ifndef G_DISABLE_ASSERT
   IFaceEntry *entry = type_lookup_iface_entry_L (node, iface);
+#endif
IFaceHolder *iholder = type_iface_retrive_holder_info_Wm (iface, NODE_TYPE (node));
   GTypeInterface *vtable;

@@ -1418,7 +1420,9 @@ type_iface_vtable_finalize_Wm (TypeNode
 			       TypeNode       *node,
 			       GTypeInterface *vtable)
 {
+#ifndef G_DISABLE_ASSERT
   IFaceEntry *entry = type_lookup_iface_entry_L (node, iface);
+#endif
   IFaceHolder *iholder = iface_node_get_holders_L (iface);

   g_assert (entry && entry->vtable == vtable);
Index: tests/testglib.c
===================================================================
RCS file: /cvs/gnome/glib/tests/testglib.c,v
retrieving revision 1.51
diff -p -u -r1.51 testglib.c
--- tests/testglib.c	2001/06/30 16:54:33	1.51
+++ tests/testglib.c	2001/07/11 00:38:07
@@ -385,11 +385,13 @@ main (int   argc,
   };
   guint n_skip_root_checks = G_N_ELEMENTS (skip_root_checks);

+#ifndef G_DISABLE_ASSERT
   guint16 gu16t1 = 0x44afU, gu16t2 = 0xaf44U;
   guint32 gu32t1 = 0x02a7f109U, gu32t2 = 0x09f1a702U;
 #ifdef G_HAVE_GINT64
   guint64 gu64t1 = G_GINT64_CONSTANT(0x1d636b02300a7aa7U),
 	  gu64t2 = G_GINT64_CONSTANT(0xa77a0a30026b631dU);
+#endif
 #endif
   const char hello[] = "Hello, World";
   const int hellolen = sizeof (hello) - 1;
Index: tests/unicode-collate.c
===================================================================
RCS file: /cvs/gnome/glib/tests/unicode-collate.c,v
retrieving revision 1.3
diff -p -u -r1.3 unicode-collate.c
--- tests/unicode-collate.c	2001/07/08 13:01:19	1.3
+++ tests/unicode-collate.c	2001/07/11 00:38:07
@@ -1,6 +1,7 @@
 #include <glib.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>

 typedef struct {
   const char *key;

===================================================================

    -- Darin




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