Skip to contentSkip to conversation

checkpolicy: use strict function prototype for definitions

PATCH In review Christian Göttsche 3 participants 6 messages Aug 8, 2022 – Aug 15, 2022 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 checkpolicy: use strict function prototype for definitions

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

---
 checkpolicy/policy_define.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
checkpolicy/policy_define.c +2 -2
index 8bf36859..f3b48870 100644
@@ -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;
Signature · 1 line
2.36.1
#1 lore raw

PATCH 2/2 restorecond: use strict function prototype for definition

Clang 15 starts to complain about non strict function definitions:

    user.c:172:10: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    int start() {
             ^
              void
---
 restorecond/user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
restorecond/user.c +1 -1
index 47b86823..3ae3ebbb 100644
@@ -169,7 +169,7 @@ io_channel_callback
   return TRUE;
 }
 
-int start() {
+int start(void) {
 #ifdef HAVE_DBUS
 	GDBusConnection *bus;
 	GError *err = NULL;
Signature · 1 line
2.36.1
Reviewed-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] restorecond: use strict function prototype for definition

Quoted 17 lines · Christian Göttsche

Clang 15 starts to complain about non strict function definitions:

     user.c:172:10: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
     int start() {
              ^
               void
---
  restorecond/user.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
restorecond/user.c +0 -0
index 47b86823..3ae3ebbb 100644

restorecond/user.c io_channel_callback · line 175

Quoted 8 lines
restorecond/user.c +1 -1
@@ -169,7 +169,7 @@ io_channel_callback
    return TRUE;
  }
 
-int start() {
+int start(void) {
  #ifdef HAVE_DBUS
  	GDBusConnection *bus;
  	GError *err = NULL;
Reviewed-by on v1 1/2
#3 lore raw
In reply to Christian Göttsche
Quoted 30 lines · Christian Göttsche

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

---
  checkpolicy/policy_define.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
checkpolicy/policy_define.c +1 -1
index 8bf36859..f3b48870 100644
@@ -4904,7 +4904,7 @@ bad:
  	return -1;
  }
 
-int define_devicetree_context()
+int define_devicetree_context(void)
  {
  	ocontext_t *newc, *c, *l, *head;
 

checkpolicy/policy_define.c int define_netif_context(void) · line 5301

Quoted 8 lines
checkpolicy/policy_define.c +1 -1
@@ -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;
Acked-by
#4 lore raw
Quoted 13 lines · Daniel Burgener
Quoted 11 lines · Christian Göttsche

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

Quoted 1 line
Quoted 1 line

For this series:

Quoted 28 lines
Quoted 18 lines
---
  checkpolicy/policy_define.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
checkpolicy/policy_define.c +1 -1
index 8bf36859..f3b48870 100644
@@ -4904,7 +4904,7 @@ bad:
      return -1;
  }
 
-int define_devicetree_context()
+int define_devicetree_context(void)
  {
      ocontext_t *newc, *c, *l, *head;
 

checkpolicy/policy_define.c int define_netif_context(void) · line 5301

Quoted 8 lines
checkpolicy/policy_define.c +1 -1
@@ -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;
#5 lore raw
Quoted 16 lines · James Carter
Quoted 13 lines · Daniel Burgener
Quoted 11 lines · Christian Göttsche

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

Quoted 5 lines
Quoted 1 line
Quoted 1 line

For this series:

This series has been merged.
Thanks,
Jim

Quoted 28 lines
Quoted 28 lines
Quoted 18 lines
---
  checkpolicy/policy_define.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
checkpolicy/policy_define.c +1 -1
index 8bf36859..f3b48870 100644
@@ -4904,7 +4904,7 @@ bad:
      return -1;
  }
 
-int define_devicetree_context()
+int define_devicetree_context(void)
  {
      ocontext_t *newc, *c, *l, *head;
 

checkpolicy/policy_define.c int define_netif_context(void) · line 5301

Quoted 8 lines
checkpolicy/policy_define.c +1 -1
@@ -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;