diff mbox

[1/1] libselinux: audit2why: remove unused module_state structure

Message ID 20161117214356.22792-1-nicolas.iooss@m4x.org (mailing list archive)
State Not Applicable
Headers show

Commit Message

Nicolas Iooss Nov. 17, 2016, 9:43 p.m. UTC
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.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
---
 libselinux/src/audit2why.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

Comments

Stephen Smalley Nov. 18, 2016, 1:55 p.m. UTC | #1
On 11/17/2016 04:43 PM, Nicolas Iooss wrote:
> 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.
> 
> Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>

Thanks, applied.

> ---
>  libselinux/src/audit2why.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/libselinux/src/audit2why.c b/libselinux/src/audit2why.c
> index abe1701616fc..3d312a10a589 100644
> --- a/libselinux/src/audit2why.c
> +++ b/libselinux/src/audit2why.c
> @@ -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,
>
diff mbox

Patch

diff --git a/libselinux/src/audit2why.c b/libselinux/src/audit2why.c
index abe1701616fc..3d312a10a589 100644
--- a/libselinux/src/audit2why.c
+++ b/libselinux/src/audit2why.c
@@ -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,