summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rsync/files/0001-Add-missing-prototypes-to-function-declarations.patch
blob: 8895adad749310d17ce75645d2b91469c661f063 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
From 651425fced0691d9063fe417388ba6ca1c38c40b Mon Sep 17 00:00:00 2001
From: Khem Raj <raj.khem@gmail.com>
Date: Mon, 29 Aug 2022 19:53:28 -0700
Subject: [PATCH] Add missing prototypes to function declarations

With Clang 15+ compiler -Wstrict-prototypes is triggering warnings which
are turned into errors with -Werror, this fixes the problem by adding
missing prototypes

Fixes errors like
| log.c:134:24: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes]
| static void syslog_init()
|                        ^
|                         void

Upstream-Status: Submitted [https://lists.samba.org/archive/rsync/2022-August/032858.html]
Signed-off-by: Khem Raj <raj.khem@gmail.com>

---
 checksum.c       | 2 +-
 exclude.c        | 2 +-
 hlink.c          | 3 +--
 lib/pool_alloc.c | 2 +-
 log.c            | 2 +-
 main.c           | 2 +-
 syscall.c        | 4 ++--
 zlib/crc32.c     | 2 +-
 zlib/trees.c     | 2 +-
 zlib/zutil.c     | 4 ++--
 10 files changed, 12 insertions(+), 13 deletions(-)

diff --git a/checksum.c b/checksum.c
index 60de365..67a9e16 100644
--- a/checksum.c
+++ b/checksum.c
@@ -778,7 +778,7 @@ static void verify_digest(struct name_num_item *nni, BOOL check_auth_list)
 }
 #endif
 
-void init_checksum_choices()
+void init_checksum_choices(void)
 {
 #if defined SUPPORT_XXH3 || defined USE_OPENSSL
 	struct name_num_item *nni;
diff --git a/exclude.c b/exclude.c
index ffe55b1..a85ea76 100644
--- a/exclude.c
+++ b/exclude.c
@@ -363,7 +363,7 @@ void implied_include_partial_string(const char *s_start, const char *s_end)
 	memcpy(partial_string_buf, s_start, partial_string_len);
 }
 
-void free_implied_include_partial_string()
+void free_implied_include_partial_string(void)
 {
 	if (partial_string_buf) {
 		if (partial_string_len)
diff --git a/hlink.c b/hlink.c
index 20291f2..5c26a6b 100644
--- a/hlink.c
+++ b/hlink.c
@@ -117,8 +117,7 @@ static void match_gnums(int32 *ndx_list, int ndx_count)
 	struct ht_int32_node *node = NULL;
 	int32 gnum, gnum_next;
 
-	qsort(ndx_list, ndx_count, sizeof ndx_list[0], (int (*)()) hlink_compare_gnum);
-
+	qsort(ndx_list, ndx_count, sizeof ndx_list[0], (int (*)(const void *, const void *)) hlink_compare_gnum);
 	for (from = 0; from < ndx_count; from++) {
 		file = hlink_flist->sorted[ndx_list[from]];
 		gnum = F_HL_GNUM(file);
diff --git a/lib/pool_alloc.c b/lib/pool_alloc.c
index a1a7245..4eae062 100644
--- a/lib/pool_alloc.c
+++ b/lib/pool_alloc.c
@@ -9,7 +9,7 @@ struct alloc_pool
 	size_t			size;		/* extent size		*/
 	size_t			quantum;	/* allocation quantum	*/
 	struct pool_extent	*extents;	/* top extent is "live" */
-	void			(*bomb)();	/* called if malloc fails */
+	void			(*bomb)(const char *, const char *, int);	/* called if malloc fails */
 	int			flags;
 
 	/* statistical data */
diff --git a/log.c b/log.c
index e4ba1cc..8482b71 100644
--- a/log.c
+++ b/log.c
@@ -131,7 +131,7 @@ static void logit(int priority, const char *buf)
 	}
 }
 
-static void syslog_init()
+static void syslog_init(void)
 {
 	int options = LOG_PID;
 
diff --git a/main.c b/main.c
index d2a7b9b..c50af45 100644
--- a/main.c
+++ b/main.c
@@ -244,7 +244,7 @@ void read_del_stats(int f)
 	stats.deleted_files += stats.deleted_specials = read_varint(f);
 }
 
-static void become_copy_as_user()
+static void become_copy_as_user(void)
 {
 	char *gname;
 	uid_t uid;
diff --git a/syscall.c b/syscall.c
index d92074a..92ca86d 100644
--- a/syscall.c
+++ b/syscall.c
@@ -389,9 +389,9 @@ OFF_T do_lseek(int fd, OFF_T offset, int whence)
 {
 #ifdef HAVE_LSEEK64
 #if !SIZEOF_OFF64_T
-	OFF_T lseek64();
+	OFF_T lseek64(int fd, OFF_T offset, int whence);
 #else
-	off64_t lseek64();
+	off64_t lseek64(int fd, off64_t offset, int whence);
 #endif
 	return lseek64(fd, offset, whence);
 #else
diff --git a/zlib/crc32.c b/zlib/crc32.c
index 05733f4..50c6c02 100644
--- a/zlib/crc32.c
+++ b/zlib/crc32.c
@@ -187,7 +187,7 @@ local void write_table(out, table)
 /* =========================================================================
  * This function can be used by asm versions of crc32()
  */
-const z_crc_t FAR * ZEXPORT get_crc_table()
+const z_crc_t FAR * ZEXPORT get_crc_table(void)
 {
 #ifdef DYNAMIC_CRC_TABLE
     if (crc_table_empty)
diff --git a/zlib/trees.c b/zlib/trees.c
index 9c66770..0d9047e 100644
--- a/zlib/trees.c
+++ b/zlib/trees.c
@@ -231,7 +231,7 @@ local void send_bits(s, value, length)
 /* ===========================================================================
  * Initialize the various 'constant' tables.
  */
-local void tr_static_init()
+local void tr_static_init(void)
 {
 #if defined(GEN_TREES_H) || !defined(STDC)
     static int static_init_done = 0;
diff --git a/zlib/zutil.c b/zlib/zutil.c
index bbba7b2..61f8dc9 100644
--- a/zlib/zutil.c
+++ b/zlib/zutil.c
@@ -27,12 +27,12 @@ z_const char * const z_errmsg[10] = {
 ""};
 
 
-const char * ZEXPORT zlibVersion()
+const char * ZEXPORT zlibVersion(void)
 {
     return ZLIB_VERSION;
 }
 
-uLong ZEXPORT zlibCompileFlags()
+uLong ZEXPORT zlibCompileFlags(void)
 {
     uLong flags;