summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-08-07 12:37:40 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-08-10 08:25:27 +0100
commit0bb5f1f99da2a3af2492b221109e696d6ba04385 (patch)
treec6b8891c8e34276b328e542a96c3e2cfc1688c44 /meta
parent0650f9c770cf675535fdfd04baa53dbc2c7a727b (diff)
downloadpoky-0bb5f1f99da2a3af2492b221109e696d6ba04385.tar.gz
cracklib: Drop using register keyword
Fixes incompatible integer to pointer conversion passing These errors are found with newer compilers e.g. clang-15 (From OE-Core rev: 71eb15c474d891855a5b18e6835993848ffa7c51) Signed-off-by: Khem Raj <raj.khem@gmail.com> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r--meta/recipes-extended/cracklib/cracklib/0001-rules-Drop-using-register-keyword.patch278
-rw-r--r--meta/recipes-extended/cracklib/cracklib/0002-rules-Correct-parameter-types-to-Debug-calls.patch40
-rw-r--r--meta/recipes-extended/cracklib/cracklib_2.9.7.bb5
3 files changed, 322 insertions, 1 deletions
diff --git a/meta/recipes-extended/cracklib/cracklib/0001-rules-Drop-using-register-keyword.patch b/meta/recipes-extended/cracklib/cracklib/0001-rules-Drop-using-register-keyword.patch
new file mode 100644
index 0000000000..a8446653eb
--- /dev/null
+++ b/meta/recipes-extended/cracklib/cracklib/0001-rules-Drop-using-register-keyword.patch
@@ -0,0 +1,278 @@
1From fe49471cfa7fe0618615c065f4c0ad04e888bf92 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 7 Aug 2022 12:24:39 -0700
4Subject: [PATCH 1/2] rules: Drop using register keyword
5
6This is a deprecated keyword
7
8Upstream-Status: Submitted [https://github.com/cracklib/cracklib/pull/48]
9Signed-off-by: Khem Raj <raj.khem@gmail.com>
10---
11 src/lib/rules.c | 94 ++++++++++++++++++++++++-------------------------
12 1 file changed, 47 insertions(+), 47 deletions(-)
13
14diff --git a/lib/rules.c b/lib/rules.c
15index 3a2aa46..6e7a12a 100644
16--- a/lib/rules.c
17+++ b/lib/rules.c
18@@ -67,8 +67,8 @@ Suffix(myword, suffix)
19 char *myword;
20 char *suffix;
21 {
22- register int i;
23- register int j;
24+ int i;
25+ int j;
26 i = strlen(myword);
27 j = strlen(suffix);
28
29@@ -83,10 +83,10 @@ Suffix(myword, suffix)
30
31 char *
32 Reverse(str) /* return a pointer to a reversal */
33- register char *str;
34+ char *str;
35 {
36- register int i;
37- register int j;
38+ int i;
39+ int j;
40 static char area[STRINGSIZE];
41 j = i = strlen(str);
42 while (*str)
43@@ -99,9 +99,9 @@ Reverse(str) /* return a pointer to a reversal */
44
45 char *
46 Uppercase(str) /* return a pointer to an uppercase */
47- register char *str;
48+ char *str;
49 {
50- register char *ptr;
51+ char *ptr;
52 static char area[STRINGSIZE];
53 ptr = area;
54 while (*str)
55@@ -116,9 +116,9 @@ Uppercase(str) /* return a pointer to an uppercase */
56
57 char *
58 Lowercase(str) /* return a pointer to an lowercase */
59- register char *str;
60+ char *str;
61 {
62- register char *ptr;
63+ char *ptr;
64 static char area[STRINGSIZE];
65 ptr = area;
66 while (*str)
67@@ -133,9 +133,9 @@ Lowercase(str) /* return a pointer to an lowercase */
68
69 char *
70 Capitalise(str) /* return a pointer to an capitalised */
71- register char *str;
72+ char *str;
73 {
74- register char *ptr;
75+ char *ptr;
76 static char area[STRINGSIZE];
77 ptr = area;
78
79@@ -152,9 +152,9 @@ Capitalise(str) /* return a pointer to an capitalised */
80
81 char *
82 Pluralise(string) /* returns a pointer to a plural */
83- register char *string;
84+ char *string;
85 {
86- register int length;
87+ int length;
88 static char area[STRINGSIZE];
89 length = strlen(string);
90 strcpy(area, string);
91@@ -193,11 +193,11 @@ Pluralise(string) /* returns a pointer to a plural */
92
93 char *
94 Substitute(string, old, new) /* returns pointer to a swapped about copy */
95- register char *string;
96- register char old;
97- register char new;
98+ char *string;
99+ char old;
100+ char new;
101 {
102- register char *ptr;
103+ char *ptr;
104 static char area[STRINGSIZE];
105 ptr = area;
106 while (*string)
107@@ -211,11 +211,11 @@ Substitute(string, old, new) /* returns pointer to a swapped about copy */
108
109 char *
110 Purge(string, target) /* returns pointer to a purged copy */
111- register char *string;
112- register char target;
113+ char *string;
114+ char target;
115 {
116- register char *ptr;
117- static char area[STRINGSIZE];
118+ char *ptr;
119+ char area[STRINGSIZE];
120 ptr = area;
121 while (*string)
122 {
123@@ -238,11 +238,11 @@ Purge(string, target) /* returns pointer to a purged copy */
124
125 int
126 MatchClass(class, input)
127- register char class;
128- register char input;
129+ char class;
130+ char input;
131 {
132- register char c;
133- register int retval;
134+ char c;
135+ int retval;
136 retval = 0;
137
138 switch (class)
139@@ -357,8 +357,8 @@ MatchClass(class, input)
140
141 char *
142 PolyStrchr(string, class)
143- register char *string;
144- register char class;
145+ char *string;
146+ char class;
147 {
148 while (*string)
149 {
150@@ -373,11 +373,11 @@ PolyStrchr(string, class)
151
152 char *
153 PolySubst(string, class, new) /* returns pointer to a swapped about copy */
154- register char *string;
155- register char class;
156- register char new;
157+ char *string;
158+ char class;
159+ char new;
160 {
161- register char *ptr;
162+ char *ptr;
163 static char area[STRINGSIZE];
164 ptr = area;
165 while (*string)
166@@ -391,10 +391,10 @@ PolySubst(string, class, new) /* returns pointer to a swapped about copy */
167
168 char *
169 PolyPurge(string, class) /* returns pointer to a purged copy */
170- register char *string;
171- register char class;
172+ char *string;
173+ char class;
174 {
175- register char *ptr;
176+ char *ptr;
177 static char area[STRINGSIZE];
178 ptr = area;
179 while (*string)
180@@ -433,7 +433,7 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
181 char *control;
182 {
183 int limit;
184- register char *ptr;
185+ char *ptr;
186 static char area[STRINGSIZE * 2] = {0};
187 char area2[STRINGSIZE * 2] = {0};
188 strcpy(area, input);
189@@ -523,7 +523,7 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
190 return NULL;
191 } else
192 {
193- register char *string;
194+ char *string;
195 string = area;
196 while (*(string++));
197 string[-1] = *(++ptr);
198@@ -537,7 +537,7 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
199 return NULL;
200 } else
201 {
202- register int i;
203+ int i;
204 int start;
205 int length;
206 start = Char2Int(*(++ptr));
207@@ -563,7 +563,7 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
208 return NULL;
209 } else
210 {
211- register int i;
212+ int i;
213 i = Char2Int(*(++ptr));
214 if (i < 0)
215 {
216@@ -587,9 +587,9 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
217 return NULL;
218 } else
219 {
220- register int i;
221- register char *p1;
222- register char *p2;
223+ int i;
224+ char *p1;
225+ char *p2;
226 i = Char2Int(*(++ptr));
227 if (i < 0)
228 {
229@@ -696,7 +696,7 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
230 return NULL;
231 } else
232 {
233- register int i;
234+ int i;
235 if ((i = Char2Int(ptr[1])) < 0)
236 {
237 Debug(1, "Mangle: '=' weird argument in '%s'\n", control);
238@@ -723,7 +723,7 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
239 case RULE_DFIRST:
240 if (area[0])
241 {
242- register int i;
243+ int i;
244 for (i = 1; area[i]; i++)
245 {
246 area[i - 1] = area[i];
247@@ -735,7 +735,7 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
248 case RULE_DLAST:
249 if (area[0])
250 {
251- register int i;
252+ int i;
253 for (i = 1; area[i]; i++);
254 area[i - 1] = '\0';
255 }
256@@ -771,7 +771,7 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
257 return NULL;
258 } else
259 {
260- register int i;
261+ int i;
262
263 for (i = 0; area[i]; i++);
264
265@@ -815,8 +815,8 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
266
267 int
268 PMatch(control, string)
269-register char *control;
270-register char *string;
271+char *control;
272+char *string;
273 {
274 while (*string && *control)
275 {
276--
2772.37.1
278
diff --git a/meta/recipes-extended/cracklib/cracklib/0002-rules-Correct-parameter-types-to-Debug-calls.patch b/meta/recipes-extended/cracklib/cracklib/0002-rules-Correct-parameter-types-to-Debug-calls.patch
new file mode 100644
index 0000000000..a8692b0cca
--- /dev/null
+++ b/meta/recipes-extended/cracklib/cracklib/0002-rules-Correct-parameter-types-to-Debug-calls.patch
@@ -0,0 +1,40 @@
1From 793921a8ee4ae7f20e1fd2bbec5196bc83176b01 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 7 Aug 2022 12:25:24 -0700
4Subject: [PATCH 2/2] rules: Correct parameter types to Debug() calls
5
6Fixes
7src/lib/rules.c:346:45: error: incompatible integer to pointer conversion passing 'char' to parameter of type 'char *'; take the address with & [-Wint-conversion]
8src/lib/rules.c:804:53: error: incompatible integer to pointer conversion passing 'char' to parameter of type 'char *'; remove * [-Wint-conversion] Debug(1, "Mangle: unknown command %c in %s\n", *ptr, control);
9 ^~~~
10Upstream-Status: Submitted [https://github.com/cracklib/cracklib/pull/48]
11Signed-off-by: Khem Raj <raj.khem@gmail.com>
12---
13 src/lib/rules.c | 4 ++--
14 1 file changed, 2 insertions(+), 2 deletions(-)
15
16diff --git a/lib/rules.c b/lib/rules.c
17index 6e7a12a..4a34f91 100644
18--- a/lib/rules.c
19+++ b/lib/rules.c
20@@ -343,7 +343,7 @@ MatchClass(class, input)
21 break;
22
23 default:
24- Debug(1, "MatchClass: unknown class %c\n", class);
25+ Debug(1, "MatchClass: unknown class %c\n", &class);
26 return (0);
27 break;
28 }
29@@ -801,7 +801,7 @@ Mangle(input, control) /* returns a pointer to a controlled Mangle */
30 }
31
32 default:
33- Debug(1, "Mangle: unknown command %c in %s\n", *ptr, control);
34+ Debug(1, "Mangle: unknown command %c in %s\n", ptr, control);
35 return NULL;
36 break;
37 }
38--
392.37.1
40
diff --git a/meta/recipes-extended/cracklib/cracklib_2.9.7.bb b/meta/recipes-extended/cracklib/cracklib_2.9.7.bb
index 629069e844..ffed88ed01 100644
--- a/meta/recipes-extended/cracklib/cracklib_2.9.7.bb
+++ b/meta/recipes-extended/cracklib/cracklib_2.9.7.bb
@@ -11,7 +11,10 @@ EXTRA_OECONF = "--without-python --libdir=${base_libdir}"
11 11
12SRC_URI = "git://github.com/cracklib/cracklib;protocol=https;branch=master \ 12SRC_URI = "git://github.com/cracklib/cracklib;protocol=https;branch=master \
13 file://0001-packlib.c-support-dictionary-byte-order-dependent.patch \ 13 file://0001-packlib.c-support-dictionary-byte-order-dependent.patch \
14 file://0002-craklib-fix-testnum-and-teststr-failed.patch" 14 file://0002-craklib-fix-testnum-and-teststr-failed.patch \
15 file://0001-rules-Drop-using-register-keyword.patch \
16 file://0002-rules-Correct-parameter-types-to-Debug-calls.patch \
17 "
15 18
16SRCREV = "f83934cf3cced0c9600c7d81332f4169f122a2cf" 19SRCREV = "f83934cf3cced0c9600c7d81332f4169f122a2cf"
17S = "${WORKDIR}/git/src" 20S = "${WORKDIR}/git/src"