Skip to contentSkip to conversation

libsemanage/tests: use strict prototypes

PATCH In review Christian Göttsche 2 participants 3 messages Aug 5, 2023 – Aug 16, 2023 SELinux security module

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsemanage/tests: use strict prototypes

    utilities.c:39:22: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    int create_test_store() {
                         ^
                          void
    utilities.c:171:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    int destroy_test_store() {
                          ^
                           void
---
 libsemanage/tests/utilities.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
libsemanage/tests/utilities.c +2 -2
index 71d7af1e..806869e0 100644
@@ -36,7 +36,7 @@ void test_msg_handler(void *varg, semanage_handle_t *handle, const char *fmt,
 {
 }
 
-int create_test_store() {
+int create_test_store(void) {
 	FILE *fptr;
 
 	if (mkdir("test-policy", 0700) < 0)
@@ -168,7 +168,7 @@ int write_test_policy_src(unsigned char *data, unsigned int data_len) {
 	return 0;
 }
 
-int destroy_test_store() {
+int destroy_test_store(void) {
 	FTS *ftsp = NULL;
 	FTSENT *curr = NULL;
 	int ret = 0;
Signature · 1 line
2.40.1
Acked-by on v1 1/1
#1 lore raw
Quoted 11 lines · Christian Göttsche
    utilities.c:39:22: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    int create_test_store() {
                         ^
                          void
    utilities.c:171:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    int destroy_test_store() {
                          ^
                           void
Quoted 29 lines
---
 libsemanage/tests/utilities.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
libsemanage/tests/utilities.c +2 -3
index 71d7af1e..806869e0 100644
@@ -36,7 +36,7 @@ void test_msg_handler(void *varg, semanage_handle_t *handle, const char *fmt,
 {
 }
 
-int create_test_store() {
+int create_test_store(void) {
        FILE *fptr;
 
        if (mkdir("test-policy", 0700) < 0)
@@ -168,7 +168,7 @@ int write_test_policy_src(unsigned char *data, unsigned int data_len) {
        return 0;
 }
 
-int destroy_test_store() {
+int destroy_test_store(void) {
        FTS *ftsp = NULL;
        FTSENT *curr = NULL;
        int ret = 0;
--

2.40.1

#2 lore raw
Quoted 13 lines · James Carter
Quoted 10 lines · Christian Göttsche
    utilities.c:39:22: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    int create_test_store() {
                         ^
                          void
    utilities.c:171:23: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
    int destroy_test_store() {
                          ^
                           void
Quoted 4 lines
Quoted 1 line

Merged.
Thanks,
Jim

Quoted 29 lines
Quoted 29 lines
---
 libsemanage/tests/utilities.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
libsemanage/tests/utilities.c +2 -3
index 71d7af1e..806869e0 100644
@@ -36,7 +36,7 @@ void test_msg_handler(void *varg, semanage_handle_t *handle, const char *fmt,
 {
 }
 
-int create_test_store() {
+int create_test_store(void) {
        FILE *fptr;
 
        if (mkdir("test-policy", 0700) < 0)
@@ -168,7 +168,7 @@ int write_test_policy_src(unsigned char *data, unsigned int data_len) {
        return 0;
 }
 
-int destroy_test_store() {
+int destroy_test_store(void) {
        FTS *ftsp = NULL;
        FTSENT *curr = NULL;
        int ret = 0;
--

2.40.1