Author: "Justin P. Mattock"

Email: justinmattock@gmail.com
Subject: libsepol
Date: Tue, 6 Jul 2010 15:23:29 -0700

Going through these warning messages Im getting:
(example 1 of many)
booleans.c: In function 'sepol_bool_count':
booleans.c:106:39: error: parameter 'handle' set but not used
cc1: all warnings being treated as errors

seems most of these go to NULL; Which tells me that these are here for
future use and/or need to be there for some other reason.
The biggest problem I have is Im getting errors out of these as opposed
to just a warning(-Werror) so marking the variable with a GCC
__attribute__ ((unused)) gets things going.

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Signed-off-by: Chad Sellers <csellers@tresys.com>
This commit is contained in:
Justin P. Mattock 2010-12-08 18:13:46 -05:00 committed by Chad Sellers
parent f997295da3
commit 033959726b
9 changed files with 10 additions and 14 deletions

View File

@ -103,7 +103,7 @@ int sepol_bool_set(sepol_handle_t * handle,
return STATUS_ERR;
}
int sepol_bool_count(sepol_handle_t * handle,
int sepol_bool_count(sepol_handle_t * handle __attribute__ ((unused)),
const sepol_policydb_t * p, unsigned int *response)
{

View File

@ -41,7 +41,7 @@ hidden_def(sepol_msg_get_fname)
#ifdef __GNUC__
__attribute__ ((format(printf, 3, 4)))
#endif
void hidden sepol_msg_default_handler(void *varg,
void hidden sepol_msg_default_handler(void *varg __attribute__ ((unused)),
sepol_handle_t * handle,
const char *fmt, ...)
{

View File

@ -106,7 +106,7 @@ static int iface_to_record(sepol_handle_t * handle,
}
/* Check if an interface exists */
int sepol_iface_exists(sepol_handle_t * handle,
int sepol_iface_exists(sepol_handle_t * handle __attribute__ ((unused)),
const sepol_policydb_t * p,
const sepol_iface_key_t * key, int *response)
{
@ -216,7 +216,7 @@ int sepol_iface_modify(sepol_handle_t * handle,
}
/* Return the number of interfaces */
extern int sepol_iface_count(sepol_handle_t * handle,
extern int sepol_iface_count(sepol_handle_t * handle __attribute__ ((unused)),
const sepol_policydb_t * p, unsigned int *response)
{

View File

@ -144,7 +144,7 @@ static int node_to_record(sepol_handle_t * handle,
}
/* Return the number of nodes */
extern int sepol_node_count(sepol_handle_t * handle,
extern int sepol_node_count(sepol_handle_t * handle __attribute__ ((unused)),
const sepol_policydb_t * p, unsigned int *response)
{

View File

@ -3234,7 +3234,7 @@ int policydb_read(policydb_t * p, struct policy_file *fp, unsigned verbose)
{
unsigned int i, j, r_policyvers;
uint32_t buf[5], config;
uint32_t buf[5];
size_t len, nprim, nel;
char *policydb_str;
struct policydb_compat_info *info;
@ -3242,8 +3242,6 @@ int policydb_read(policydb_t * p, struct policy_file *fp, unsigned verbose)
ebitmap_node_t *tnode;
int rc;
config = 0;
/* Read the magic number and string length. */
rc = next_entry(buf, fp, sizeof(uint32_t) * 2);
if (rc < 0)

View File

@ -140,7 +140,7 @@ static int port_to_record(sepol_handle_t * handle,
}
/* Return the number of ports */
extern int sepol_port_count(sepol_handle_t * handle,
extern int sepol_port_count(sepol_handle_t * handle __attribute__ ((unused)),
const sepol_policydb_t * p, unsigned int *response)
{

View File

@ -8,7 +8,7 @@
#include "handle.h"
/* Check if a role exists */
int sepol_role_exists(sepol_handle_t * handle,
int sepol_role_exists(sepol_handle_t * handle __attribute__ ((unused)),
sepol_policydb_t * p, const char *role, int *response)
{

View File

@ -1003,7 +1003,6 @@ int hidden sepol_load_policy(void *data, size_t len)
policydb_t oldpolicydb, newpolicydb;
sidtab_t oldsidtab, newsidtab;
convert_context_args_t args;
uint32_t seqno;
int rc = 0;
struct policy_file file, *fp;
@ -1050,7 +1049,6 @@ int hidden sepol_load_policy(void *data, size_t len)
/* Install the new policydb and SID table. */
memcpy(policydb, &newpolicydb, sizeof *policydb);
sepol_sidtab_set(sidtab, &newsidtab);
seqno = ++latest_granting;
/* Free the old policydb and SID table. */
policydb_destroy(&oldpolicydb);

View File

@ -284,7 +284,7 @@ int sepol_user_modify(sepol_handle_t * handle,
return STATUS_ERR;
}
int sepol_user_exists(sepol_handle_t * handle,
int sepol_user_exists(sepol_handle_t * handle __attribute__ ((unused)),
const sepol_policydb_t * p,
const sepol_user_key_t * key, int *response)
{
@ -301,7 +301,7 @@ int sepol_user_exists(sepol_handle_t * handle,
return STATUS_SUCCESS;
}
int sepol_user_count(sepol_handle_t * handle,
int sepol_user_count(sepol_handle_t * handle __attribute__ ((unused)),
const sepol_policydb_t * p, unsigned int *response)
{