libsepol: remove unused attribute on a used argument
PATCH 1/1 libsepol: remove unused attribute on a used argument
Since commit 58962eb3d847 ("libsepol,checkpolicy: add binary module support for xperms") function display_avrule() has been using its "p" argument even though it was previously marked unused. This makes clang report:
policydb.c:3276:7: error: 'p' was marked unused but was used
[-Werror,-Wused-but-marked-unused].
if (p->policyvers < MOD_POLICYDB_VERSION_XPERMS_IOCTL) {
^Remove the attribute to make the code consistent again.
--- libsepol/src/policydb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
libsepol/src/policydb.c +1 -2
@@ -3212,8 +3212,7 @@ common_read, class_read, role_read, type_read, user_read,/************** module reading functions below **************/ -static avrule_t *avrule_read (policydb_t * p - __attribute__ ((unused)),struct policy_file *fp) +static avrule_t *avrule_read (policydb_t * p,struct policy_file *fp) {unsigned int i;uint32_t buf[2 ], len;
Signature · 1 line
2.13.0
Quoted 4 lines · Nicolas Iooss
Since commit
58962eb3d847("libsepol,checkpolicy: add binary module support for xperms") functiondisplay_avrule()has been using its "p" argument even though it was previously marked unused. This makes clang report:
Of course it is function avrule_read() instead. I commited and sent this patch too quickly. Would you like me to send a patch with a fixed description?
Nicolas
Quoted 30 lines
policydb.c:3276:7: error: 'p' was marked unused but was used [-Werror,-Wused-but-marked-unused]. if (p->policyvers < MOD_POLICYDB_VERSION_XPERMS_IOCTL) { ^Remove the attribute to make the code consistent again.
Signed-off-by Nicolas Iooss <[email protected]>--- libsepol/src/policydb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)libsepol/src/policydb.c +1
-3@@ -3212,8 +3212,7 @@ common_read, class_read, role_read, type_read, user_read,/************** module reading functions below **************/ -static avrule_t *avrule_read (policydb_t * p - __attribute__ ((unused)),struct policy_file *fp) +static avrule_t *avrule_read (policydb_t * p,struct policy_file *fp) {unsigned int i;uint32_t buf[2 ], len; --2.13.0
Quoted 9 lines · Nicolas Iooss
Quoted 6 lines · Nicolas Iooss
Since commit
58962eb3d847("libsepol,checkpolicy: add binary module support for xperms") functiondisplay_avrule()has been using its "p"
argument even though it was previously marked unused. This makes clang
report:
Quoted 4 lines
Of course it is function
avrule_read()instead. I commited and sent this patch too quickly. Would you like me to send a patch with a fixed
description?
No, not necessary, thanks.
Quoted 35 lines
Nicolas
Quoted 33 lines
policydb.c:3276:7: error: 'p' was marked unused but was used [-Werror,-Wused-but-marked-unused].
if (p->policyvers<MOD_POLICYDB_VERSION_XPERMS_IOCTL) { ^Remove the attribute to make the code consistent again.
Signed-off-by Nicolas Iooss <[email protected]>---
libsepol/src/policydb.c | 3 +--1 file changed, 1 insertion(+), 2 deletions(-)libsepol/src/policydb.c +1
-2@@ -3212,8 +3212,7 @@ common_read, class_read, role_read, type_read, user_read, /************** module reading functions below **************/ -static avrule_t *avrule_read(policydb_t * p - __attribute__ ((unused)), struct policy_file *fp) +static avrule_t *avrule_read(policydb_t * p, struct policy_file *fp){
unsigned int i;
uint32_t buf[2], len;
--
2.13.0
Quoted 6 lines · Nicolas Iooss
Since commit
58962eb3d847("libsepol,checkpolicy: add binary module support for xperms") functiondisplay_avrule()has been using its "p" argument even though it was previously marked unused. This makes clang
report:
Quoted 6 lines
policydb.c:3276:7: error: 'p' was marked unused but was used [-Werror,-Wused-but-marked-unused].
if (p->policyvers<MOD_POLICYDB_VERSION_XPERMS_IOCTL) { ^Remove the attribute to make the code consistent again.
Applied with corrected description.
Quoted 22 lines
Signed-off-by Nicolas Iooss <[email protected]>---
libsepol/src/policydb.c | 3 +--1 file changed, 1 insertion(+), 2 deletions(-)libsepol/src/policydb.c +0
-0@@ -3212,8 +3212,7 @@ common_read, class_read, role_read, type_read, user_read,
/************** module reading functions below **************/libsepol/src/policydb.c +0
-2-static avrule_t *avrule_read(policydb_t * p - __attribute__ ((unused)), struct
policy_file*fp)
+staticavrule_t*avrule_read(policydb_t * p, structpolicy_file*fp) {
unsigned int i;
uint32_tbuf[2], len;