[PATCH 1/3]libsemanage Fix warning: parameter 'key' set but not used(and others)

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

 



libsemanage produced no errors with the warnings, Im just noticing
big hunks of sections with warning messages:

database_llist.c: In function 'dbase_llist_add':
database_llist.c:150:28: warning: parameter 'key' set but not used
database_llist.c: In function 'dbase_llist_count':
database_llist.c:221:50: warning: parameter 'handle' set but not used
database_llist.c: In function 'dbase_llist_del':
database_llist.c:278:41: warning: parameter 'handle' set but not used
(and so on...)
so add the GCC attribute to quiet these warnings since most go to
NULL;

Signed-off-by: Justin P. Mattock <justinmattock@xxxxxxxxx>

---
 libsemanage/src/database_llist.c    |    7 ++++---
 libsemanage/src/database_policydb.c |   18 ++++++++++++------
 libsemanage/src/debug.c             |    2 +-
 libsemanage/src/direct_api.c        |    3 ++-
 4 files changed, 19 insertions(+), 11 deletions(-)

diff --git a/libsemanage/src/database_llist.c b/libsemanage/src/database_llist.c
index 1cb7454..5f0c147 100644
--- a/libsemanage/src/database_llist.c
+++ b/libsemanage/src/database_llist.c
@@ -147,7 +147,8 @@ int dbase_llist_exists(semanage_handle_t * handle,
 
 int dbase_llist_add(semanage_handle_t * handle,
 		    dbase_llist_t * dbase,
-		    const record_key_t * key, const record_t * data)
+		    const record_key_t * key __attribute__ ((unused)),
+			 const record_t * data)
 {
 
 	if (dbase_llist_cache_prepend(handle, dbase, data) < 0)
@@ -218,7 +219,7 @@ int dbase_llist_modify(semanage_handle_t * handle,
 	return STATUS_ERR;
 }
 
-hidden int dbase_llist_count(semanage_handle_t * handle,
+hidden int dbase_llist_count(semanage_handle_t * handle __attribute__ ((unused)),
 			     dbase_llist_t * dbase, unsigned int *response)
 {
 
@@ -275,7 +276,7 @@ int dbase_llist_iterate(semanage_handle_t * handle,
 	return STATUS_ERR;
 }
 
-int dbase_llist_del(semanage_handle_t * handle,
+int dbase_llist_del(semanage_handle_t * handle __attribute__ ((unused)),
 		    dbase_llist_t * dbase, const record_key_t * key)
 {
 
diff --git a/libsemanage/src/database_policydb.c b/libsemanage/src/database_policydb.c
index 839dcbe..94850b7 100644
--- a/libsemanage/src/database_policydb.c
+++ b/libsemanage/src/database_policydb.c
@@ -177,7 +177,8 @@ static int dbase_policydb_cache(semanage_handle_t * handle,
 	return STATUS_ERR;
 }
 
-static int dbase_policydb_flush(semanage_handle_t * handle,
+static int dbase_policydb_flush(semanage_handle_t * handle
+				__attribute__ ((unused)),
 				dbase_policydb_t * dbase)
 {
 
@@ -309,9 +310,12 @@ static int dbase_policydb_modify(semanage_handle_t * handle,
 	return STATUS_ERR;
 }
 
-static int dbase_policydb_del(semanage_handle_t * handle,
-			      dbase_policydb_t * dbase,
-			      const record_key_t * key)
+static int dbase_policydb_del(semanage_handle_t * handle
+				__attribute__ ((unused)),
+			      dbase_policydb_t * dbase
+				__attribute__ ((unused)),
+			      const record_key_t * key
+				__attribute__ ((unused)))
 {
 
 	/* Stub */
@@ -321,8 +325,10 @@ static int dbase_policydb_del(semanage_handle_t * handle,
 	return STATUS_ERR;
 }
 
-static int dbase_policydb_clear(semanage_handle_t * handle,
-				dbase_policydb_t * dbase)
+static int dbase_policydb_clear(semanage_handle_t * handle
+				__attribute__ ((unused)),
+				dbase_policydb_t * dbase
+				__attribute__ ((unused)))
 {
 
 	/* Stub */
diff --git a/libsemanage/src/debug.c b/libsemanage/src/debug.c
index 4b96c30..90d4b4e 100644
--- a/libsemanage/src/debug.c
+++ b/libsemanage/src/debug.c
@@ -51,7 +51,7 @@ hidden_def(semanage_msg_get_fname)
 #ifdef __GNUC__
     __attribute__ ((format(printf, 3, 4)))
 #endif
-void hidden semanage_msg_default_handler(void *varg,
+void hidden semanage_msg_default_handler(void *varg __attribute__ ((unused)),
 					 semanage_handle_t * handle,
 					 const char *fmt, ...)
 {
diff --git a/libsemanage/src/direct_api.c b/libsemanage/src/direct_api.c
index 399d740..bceb6a7 100644
--- a/libsemanage/src/direct_api.c
+++ b/libsemanage/src/direct_api.c
@@ -243,7 +243,8 @@ int semanage_direct_connect(semanage_handle_t * sh)
 	return STATUS_ERR;
 }
 
-static void semanage_direct_destroy(semanage_handle_t * sh)
+static void semanage_direct_destroy(semanage_handle_t * sh
+					__attribute__ ((unused)))
 {
 	/* do nothing */
 	sh = NULL;
-- 
1.7.1.rc1.21.gf3bd6


--
This message was distributed to subscribers of the selinux mailing list.
If you no longer wish to subscribe, send mail to majordomo@xxxxxxxxxxxxx with
the words "unsubscribe selinux" without quotes as the message.


[Index of Archives]     [Selinux Refpolicy]     [Linux SGX]     [Fedora Users]     [Fedora Desktop]     [Yosemite Photos]     [Yosemite Camping]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux