Skip to contentSkip to conversation

libselinux: audit2why: remove unused module_state structure

PATCH Applied Nicolas Iooss 2 participants 2 messages Nov 17, 2016 – Nov 18, 2016 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libselinux: audit2why: remove unused module_state structure

This structure has been empty since its introduction and makes clang complain when $(filter-out -Werror, $(CFLAGS)) is removed in the Makefile target for audit2why.lo:

    audit2why.c:443:1: error: empty struct has size 0 in C, size 1 in
    C++ [-Werror,-Wc++-compat]
      struct module_state {
      ^
      1 error generated.
---
 libselinux/src/audit2why.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
libselinux/src/audit2why.c +1 -4
index abe1701616fc..3d312a10a589 100644
@@ -440,14 +440,11 @@ static PyMethodDef audit2whyMethods[] = {
 
 #if PY_MAJOR_VERSION >= 3
 /* Module-initialization logic specific to Python 3 */
-struct module_state {
-	/* empty for now */
-};
 static struct PyModuleDef moduledef = {
 	PyModuleDef_HEAD_INIT,
 	"audit2why",
 	NULL,
-	sizeof(struct module_state),
+	0,
 	audit2whyMethods,
 	NULL,
 	NULL,
Signature · 1 line
2.10.2
#1 lore raw
Quoted 11 lines · Nicolas Iooss

This structure has been empty since its introduction and makes clang complain when $(filter-out -Werror, $(CFLAGS)) is removed in the Makefile target for audit2why.lo:

    audit2why.c:443:1: error: empty struct has size 0 in C, size 1 in
    C++ [-Werror,-Wc++-compat]
      struct module_state {
      ^
      1 error generated.

Thanks, applied.

Quoted 25 lines
---
 libselinux/src/audit2why.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
libselinux/src/audit2why.c +1 -4
index abe1701616fc..3d312a10a589 100644
@@ -440,14 +440,11 @@ static PyMethodDef audit2whyMethods[] = {
 
 #if PY_MAJOR_VERSION >= 3
 /* Module-initialization logic specific to Python 3 */
-struct module_state {
-	/* empty for now */
-};
 static struct PyModuleDef moduledef = {
 	PyModuleDef_HEAD_INIT,
 	"audit2why",
 	NULL,
-	sizeof(struct module_state),
+	0,
 	audit2whyMethods,
 	NULL,
 	NULL,