Bug#451497: g_assert macro is not -Wall clean

Wouter Verhelst wouter at debian.org
Thu Nov 15 22:54:55 UTC 2007


Package: libglib2.0-dev
Version: 2.14.3-1
Severity: minor
Tags: patch

Hi,

Script started on Thu Nov 15 23:49:23 2007
wouter at country:~/debian/nbd/nbd-svn-2.9$ make
make  all-am
make[1]: Entering directory `/home/wouter/debian/nbd/nbd-svn-2.9'
if gcc -DHAVE_CONFIG_H -I. -I. -I.  -DSYSCONFDIR='"/usr/local/etc"'  -g -O2 -Wall -Werror -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include   -g -O2 -Wall -Werror -MT nbd_server-nbd-server.o -MD -MP -MF ".deps/nbd_server-nbd-server.Tpo" -c -o nbd_server-nbd-server.o `test -f 'nbd-server.c' || echo './'`nbd-server.c; \
	then mv -f ".deps/nbd_server-nbd-server.Tpo" ".deps/nbd_server-nbd-server.Po"; else rm -f ".deps/nbd_server-nbd-server.Tpo"; exit 1; fi
cc1: warnings being treated as errors
nbd-server.c: In function 'parse_cfile':
nbd-server.c:616: warning: passing argument 4 of 'g_assert_warning' discards qualifiers from pointer target type
nbd-server.c:617: warning: passing argument 4 of 'g_assert_warning' discards qualifiers from pointer target type
nbd-server.c: In function 'get_filepos':
nbd-server.c:849: warning: passing argument 4 of 'g_assert_warning' discards qualifiers from pointer target type
make[1]: *** [nbd_server-nbd-server.o] Error 1
make[1]: Leaving directory `/home/wouter/debian/nbd/nbd-svn-2.9'
make: *** [all] Error 2
wouter at country:~/debian/nbd/nbd-svn-2.9$ exit

Script done on Thu Nov 15 23:49:26 2007

This shouldn't happen, really. A simple patch:

--- gmessages.h.orig	2007-11-15 23:54:14.000000000 +0100
+++ gmessages.h	2007-11-15 23:53:47.000000000 +0100
@@ -232,14 +232,14 @@
         g_assert_warning (G_LOG_DOMAIN,				\
 	                  __FILE__,    				\
 	                  __LINE__,	      			\
-	                  __PRETTY_FUNCTION__,	      		\
+	                  (const gchar*)__PRETTY_FUNCTION__,	      		\
 	                  #expr);		  }G_STMT_END
 
 #define g_assert_not_reached()		G_STMT_START{		\
         g_assert_warning (G_LOG_DOMAIN,				\
 	                  __FILE__,    				\
 	                  __LINE__,	      			\
-	                  __PRETTY_FUNCTION__,	      		\
+	                  (const gchar*)__PRETTY_FUNCTION__,	      		\
 	                  NULL);		  }G_STMT_END
 
 #else /* !__GNUC__ */
@@ -280,7 +280,7 @@
      if G_LIKELY(expr) { } else       					\
        {								\
 	 g_return_if_fail_warning (G_LOG_DOMAIN,			\
-		                   __PRETTY_FUNCTION__,		        \
+		                   (const gchar*)__PRETTY_FUNCTION__,		        \
 		                   #expr);				\
 	 return;							\
        };				}G_STMT_END
@@ -289,7 +289,7 @@
      if G_LIKELY(expr) { } else						\
        {								\
 	 g_return_if_fail_warning (G_LOG_DOMAIN,			\
-		                   __PRETTY_FUNCTION__,		        \
+		                   (const gchar*)__PRETTY_FUNCTION__,		        \
 		                   #expr);				\
 	 return (val);							\
        };				}G_STMT_END
@@ -300,7 +300,7 @@
 	    "file %s: line %d (%s): should not be reached",		\
 	    __FILE__,							\
 	    __LINE__,							\
-	    __PRETTY_FUNCTION__);					\
+	    (const gchar*)__PRETTY_FUNCTION__);					\
      return;				}G_STMT_END
 
 #define g_return_val_if_reached(val)	G_STMT_START{			\
@@ -309,7 +309,7 @@
 	    "file %s: line %d (%s): should not be reached",		\
 	    __FILE__,							\
 	    __LINE__,							\
-	    __PRETTY_FUNCTION__);					\
+	    (const gchar*)__PRETTY_FUNCTION__);					\
      return (val);			}G_STMT_END
 
 #else /* !__GNUC__ */

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: powerpc (ppc)

Kernel: Linux 2.6.22-3-powerpc
Locale: LANG=nl_BE.UTF-8, LC_CTYPE=nl_BE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libglib2.0-dev depends on:
ii  libglib2.0-0                  2.14.3-1   The GLib library of C routines
ii  pkg-config                    0.22-1     manage compile and link flags for 

libglib2.0-dev recommends no packages.

-- no debconf information






More information about the pkg-gnome-maintainers mailing list