diff mbox series

[1/2] checkpolicy: use strict function prototype for definitions

Message ID 20220808173620.16760-1-cgzones@googlemail.com (mailing list archive)
State Accepted
Commit 2a9c619b5fec
Headers show
Series [1/2] checkpolicy: use strict function prototype for definitions | expand

Commit Message

Christian Göttsche Aug. 8, 2022, 5:36 p.m. UTC
Clang 15 starts to complain about non strict function definitions:

    policy_define.c:4907:30: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    int define_devicetree_context()
                                 ^
                                  void
    policy_define.c:5298:29: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    int define_ipv4_node_context()
                                ^
                                 void

Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
---
 checkpolicy/policy_define.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Daniel Burgener Aug. 9, 2022, 1:56 p.m. UTC | #1
On 8/8/2022 1:36 PM, Christian Göttsche wrote:
> Clang 15 starts to complain about non strict function definitions:
> 
>      policy_define.c:4907:30: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
>      int define_devicetree_context()
>                                   ^
>                                    void
>      policy_define.c:5298:29: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
>      int define_ipv4_node_context()
>                                  ^
>                                   void
> 
> Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
> ---
>   checkpolicy/policy_define.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c
> index 8bf36859..f3b48870 100644
> --- a/checkpolicy/policy_define.c
> +++ b/checkpolicy/policy_define.c
> @@ -4904,7 +4904,7 @@ bad:
>   	return -1;
>   }
>   
> -int define_devicetree_context()
> +int define_devicetree_context(void)
>   {
>   	ocontext_t *newc, *c, *l, *head;
>   
> @@ -5295,7 +5295,7 @@ int define_netif_context(void)
>   	return 0;
>   }
>   
> -int define_ipv4_node_context()
> +int define_ipv4_node_context(void)
>   {	
>   	char *id;
>   	int rc = 0;

Reviewed-by: Daniel Burgener <dburgener@linux.microsoft.com>
James Carter Aug. 10, 2022, 3:34 p.m. UTC | #2
On Tue, Aug 9, 2022 at 10:06 AM Daniel Burgener
<dburgener@linux.microsoft.com> wrote:
>
> On 8/8/2022 1:36 PM, Christian Göttsche wrote:
> > Clang 15 starts to complain about non strict function definitions:
> >
> >      policy_define.c:4907:30: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
> >      int define_devicetree_context()
> >                                   ^
> >                                    void
> >      policy_define.c:5298:29: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
> >      int define_ipv4_node_context()
> >                                  ^
> >                                   void
> >
> > Signed-off-by: Christian Göttsche <cgzones@googlemail.com>

For this series:
Acked-by: James Carter <jwcart2@gmail.com>

> > ---
> >   checkpolicy/policy_define.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c
> > index 8bf36859..f3b48870 100644
> > --- a/checkpolicy/policy_define.c
> > +++ b/checkpolicy/policy_define.c
> > @@ -4904,7 +4904,7 @@ bad:
> >       return -1;
> >   }
> >
> > -int define_devicetree_context()
> > +int define_devicetree_context(void)
> >   {
> >       ocontext_t *newc, *c, *l, *head;
> >
> > @@ -5295,7 +5295,7 @@ int define_netif_context(void)
> >       return 0;
> >   }
> >
> > -int define_ipv4_node_context()
> > +int define_ipv4_node_context(void)
> >   {
> >       char *id;
> >       int rc = 0;
>
> Reviewed-by: Daniel Burgener <dburgener@linux.microsoft.com>
James Carter Aug. 15, 2022, 3:54 p.m. UTC | #3
On Wed, Aug 10, 2022 at 11:34 AM James Carter <jwcart2@gmail.com> wrote:
>
> On Tue, Aug 9, 2022 at 10:06 AM Daniel Burgener
> <dburgener@linux.microsoft.com> wrote:
> >
> > On 8/8/2022 1:36 PM, Christian Göttsche wrote:
> > > Clang 15 starts to complain about non strict function definitions:
> > >
> > >      policy_define.c:4907:30: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
> > >      int define_devicetree_context()
> > >                                   ^
> > >                                    void
> > >      policy_define.c:5298:29: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
> > >      int define_ipv4_node_context()
> > >                                  ^
> > >                                   void
> > >
> > > Signed-off-by: Christian Göttsche <cgzones@googlemail.com>
>
> For this series:
> Acked-by: James Carter <jwcart2@gmail.com>
>
This series has been merged.
Thanks,
Jim

> > > ---
> > >   checkpolicy/policy_define.c | 4 ++--
> > >   1 file changed, 2 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c
> > > index 8bf36859..f3b48870 100644
> > > --- a/checkpolicy/policy_define.c
> > > +++ b/checkpolicy/policy_define.c
> > > @@ -4904,7 +4904,7 @@ bad:
> > >       return -1;
> > >   }
> > >
> > > -int define_devicetree_context()
> > > +int define_devicetree_context(void)
> > >   {
> > >       ocontext_t *newc, *c, *l, *head;
> > >
> > > @@ -5295,7 +5295,7 @@ int define_netif_context(void)
> > >       return 0;
> > >   }
> > >
> > > -int define_ipv4_node_context()
> > > +int define_ipv4_node_context(void)
> > >   {
> > >       char *id;
> > >       int rc = 0;
> >
> > Reviewed-by: Daniel Burgener <dburgener@linux.microsoft.com>
diff mbox series

Patch

diff --git a/checkpolicy/policy_define.c b/checkpolicy/policy_define.c
index 8bf36859..f3b48870 100644
--- a/checkpolicy/policy_define.c
+++ b/checkpolicy/policy_define.c
@@ -4904,7 +4904,7 @@  bad:
 	return -1;
 }
 
-int define_devicetree_context()
+int define_devicetree_context(void)
 {
 	ocontext_t *newc, *c, *l, *head;
 
@@ -5295,7 +5295,7 @@  int define_netif_context(void)
 	return 0;
 }
 
-int define_ipv4_node_context()
+int define_ipv4_node_context(void)
 {	
 	char *id;
 	int rc = 0;