[PATCH] Suppress glib warnings

Ralph Boehme slow at samba.org
Mon Apr 25 11:36:11 UTC 2016


Hi!

s3/rpc_server: mdssvc: suppress compiler warnings from glib headers

Several glib headers produce cast-qual warnings, eg:

/usr/include/glib-2.0/gio/gliststore.h: In function ‘G_LIST_STORE’:
/usr/include/glib-2.0/gio/gliststore.h:36:382: error: cast discards
‘const’ qualifier from pointer target type [-Werror=cast-qual]
/usr/include/glib-2.0/gio/gliststore.h: In function ‘G_IS_LIST_STORE’:
/usr/include/glib-2.0/gio/gliststore.h:36:550: error: cast discards
‘const’ qualifier from pointer target type [-Werror=cast-qual]
cc1: all warnings being treated as errors

This break compiling with --picky-developer, so lets suppress the
warning for glib in order to see our own --picky-developer compiler
diagnostics.

Cheerio!
-slow
-------------- next part --------------
From 9bc63d873a271b1f40b937f8117eed6531570108 Mon Sep 17 00:00:00 2001
From: Ralph Boehme <slow at samba.org>
Date: Mon, 25 Apr 2016 13:20:31 +0200
Subject: [PATCH] s3/rpc_server: mdssvc: suppress compiler warnings from glib
 headers
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Several glib headers produce cast-qual warnings, eg:

/usr/include/glib-2.0/gio/gliststore.h: In function ‘G_LIST_STORE’:
/usr/include/glib-2.0/gio/gliststore.h:36:382: error: cast discards
‘const’ qualifier from pointer target type [-Werror=cast-qual]
/usr/include/glib-2.0/gio/gliststore.h: In function ‘G_IS_LIST_STORE’:
/usr/include/glib-2.0/gio/gliststore.h:36:550: error: cast discards
‘const’ qualifier from pointer target type [-Werror=cast-qual]
cc1: all warnings being treated as errors

This break compiling with --picky-developer, so lets suppress the
warning for glibs in order to see our own --picky-developer compiler
diagnostics.

Signed-off-by: Ralph Boehme <slow at samba.org>
---
 source3/rpc_server/mdssvc/mdssvc.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/source3/rpc_server/mdssvc/mdssvc.h b/source3/rpc_server/mdssvc/mdssvc.h
index 2c9dc83..091cd97 100644
--- a/source3/rpc_server/mdssvc/mdssvc.h
+++ b/source3/rpc_server/mdssvc/mdssvc.h
@@ -33,8 +33,11 @@
  */
 #undef TRUE
 #undef FALSE
+/* allow building with --picky-developer */
+#pragma GCC diagnostic ignored "-Wcast-qual"
 #include <gio/gio.h>
 #include <tracker-sparql.h>
+#pragma GCC diagnostic pop
 
 #define MAX_SL_FRAGMENT_SIZE 0xFFFFF
 #define MAX_SL_RESULTS 100
-- 
2.5.0



More information about the samba-technical mailing list