diff options
Diffstat (limited to 'meta/recipes-extended/libidn')
3 files changed, 1004 insertions, 156 deletions
diff --git a/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch b/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch index 5adc7d9fd9..2d5faabb24 100644 --- a/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch +++ b/meta/recipes-extended/libidn/libidn/0001-idn-fix-printf-format-security-warnings.patch | |||
@@ -1,181 +1,694 @@ | |||
1 | From 82f98dcbc429bbe89a9837c533cbcbc02e77c790 Mon Sep 17 00:00:00 2001 | 1 | From 7148adf34dae30345c2e4d9d437838a45ba6f6e8 Mon Sep 17 00:00:00 2001 |
2 | From: =?UTF-8?q?Andr=C3=A9=20Draszik?= <adraszik@tycoint.com> | 2 | From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de> |
3 | Date: Tue, 28 Jun 2016 12:43:31 +0100 | 3 | Date: Wed, 1 Feb 2017 11:06:39 +0100 |
4 | Subject: [PATCH] idn: fix printf() format security warnings | 4 | Subject: [PATCH] Fix -Wformat warnings |
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | 5 | ||
9 | | ../../libidn-1.32/src/idn.c: In function 'main': | ||
10 | | ../../libidn-1.32/src/idn.c:172:7: error: format not a string literal and no format arguments [-Werror=format-security] | ||
11 | | error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified")); | ||
12 | | ^~~~~ | ||
13 | | ../../libidn-1.32/src/idn.c:187:5: error: format not a string literal and no format arguments [-Werror=format-security] | ||
14 | | fprintf (stderr, _("Type each input string on a line by itself, " | ||
15 | | ^~~~~~~ | ||
16 | | ../../libidn-1.32/src/idn.c:202:4: error: format not a string literal and no format arguments [-Werror=format-security] | ||
17 | | error (EXIT_FAILURE, errno, _("input error")); | ||
18 | | ^~~~~ | ||
19 | | ../../libidn-1.32/src/idn.c:220:8: error: format not a string literal and no format arguments [-Werror=format-security] | ||
20 | | _("could not convert from UTF-8 to UCS-4")); | ||
21 | | ^ | ||
22 | | ../../libidn-1.32/src/idn.c:245:8: error: format not a string literal and no format arguments [-Werror=format-security] | ||
23 | | _("could not convert from UTF-8 to UCS-4")); | ||
24 | | ^ | ||
25 | | ../../libidn-1.32/src/idn.c:281:6: error: format not a string literal and no format arguments [-Werror=format-security] | ||
26 | | _("could not convert from UTF-8 to UCS-4")); | ||
27 | | ^ | ||
28 | | ../../libidn-1.32/src/idn.c:340:6: error: format not a string literal and no format arguments [-Werror=format-security] | ||
29 | | _("could not convert from UCS-4 to UTF-8")); | ||
30 | | ^ | ||
31 | | ../../libidn-1.32/src/idn.c:364:6: error: format not a string literal and no format arguments [-Werror=format-security] | ||
32 | | _("could not convert from UCS-4 to UTF-8")); | ||
33 | | ^ | ||
34 | | ../../libidn-1.32/src/idn.c:442:8: error: format not a string literal and no format arguments [-Werror=format-security] | ||
35 | | _("could not convert from UCS-4 to UTF-8")); | ||
36 | | ^ | ||
37 | | ../../libidn-1.32/src/idn.c:498:6: error: format not a string literal and no format arguments [-Werror=format-security] | ||
38 | | _("could not convert from UTF-8 to UCS-4")); | ||
39 | | ^ | ||
40 | | ../../libidn-1.32/src/idn.c:527:5: error: format not a string literal and no format arguments [-Werror=format-security] | ||
41 | | _("could not convert from UTF-8 to UCS-4")); | ||
42 | | ^ | ||
43 | | ../../libidn-1.32/src/idn.c:540:6: error: format not a string literal and no format arguments [-Werror=format-security] | ||
44 | | error (EXIT_FAILURE, 0, _("could not do NFKC normalization")); | ||
45 | | ^~~~~ | ||
46 | | ../../libidn-1.32/src/idn.c:551:5: error: format not a string literal and no format arguments [-Werror=format-security] | ||
47 | | _("could not convert from UTF-8 to UCS-4")); | ||
48 | | ^ | ||
49 | |||
50 | Signed-off-by: André Draszik <adraszik@tycoint.com> | ||
51 | --- | 6 | --- |
52 | Upstream-Status: Pending | 7 | Upstream-Status: Backport |
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
53 | 9 | ||
54 | src/idn.c | 27 ++++++++++++++------------- | 10 | examples/example.c | 6 +++--- |
55 | 1 file changed, 14 insertions(+), 13 deletions(-) | 11 | examples/example3.c | 4 ++-- |
12 | examples/example4.c | 4 ++-- | ||
13 | examples/example5.c | 2 +- | ||
14 | src/idn.c | 2 +- | ||
15 | tests/tst_idna.c | 25 +++++++++++++------------ | ||
16 | tests/tst_idna2.c | 8 ++++---- | ||
17 | tests/tst_idna3.c | 8 ++++---- | ||
18 | tests/tst_nfkc.c | 8 ++++---- | ||
19 | tests/tst_pr29.c | 12 ++++++------ | ||
20 | tests/tst_punycode.c | 13 +++++++------ | ||
21 | tests/tst_strerror.c | 20 ++++++++++---------- | ||
22 | tests/tst_stringprep.c | 12 ++++++------ | ||
23 | tests/tst_tld.c | 20 ++++++++++---------- | ||
24 | tests/utils.c | 6 +++--- | ||
25 | 15 files changed, 76 insertions(+), 74 deletions(-) | ||
56 | 26 | ||
27 | diff --git a/examples/example.c b/examples/example.c | ||
28 | index 6e91783..24f64e0 100644 | ||
29 | --- a/examples/example.c | ||
30 | +++ b/examples/example.c | ||
31 | @@ -55,7 +55,7 @@ main (void) | ||
32 | |||
33 | printf ("Before locale2utf8 (length %ld): ", (long int) strlen (buf)); | ||
34 | for (i = 0; i < strlen (buf); i++) | ||
35 | - printf ("%02x ", buf[i] & 0xFF); | ||
36 | + printf ("%02x ", (unsigned) buf[i] & 0xFF); | ||
37 | printf ("\n"); | ||
38 | |||
39 | p = stringprep_locale_to_utf8 (buf); | ||
40 | @@ -69,7 +69,7 @@ main (void) | ||
41 | |||
42 | printf ("Before stringprep (length %ld): ", (long int) strlen (buf)); | ||
43 | for (i = 0; i < strlen (buf); i++) | ||
44 | - printf ("%02x ", buf[i] & 0xFF); | ||
45 | + printf ("%02x ", (unsigned) buf[i] & 0xFF); | ||
46 | printf ("\n"); | ||
47 | |||
48 | rc = stringprep (buf, BUFSIZ, 0, stringprep_nameprep); | ||
49 | @@ -79,7 +79,7 @@ main (void) | ||
50 | { | ||
51 | printf ("After stringprep (length %ld): ", (long int) strlen (buf)); | ||
52 | for (i = 0; i < strlen (buf); i++) | ||
53 | - printf ("%02x ", buf[i] & 0xFF); | ||
54 | + printf ("%02x ", (unsigned) buf[i] & 0xFF); | ||
55 | printf ("\n"); | ||
56 | } | ||
57 | |||
58 | diff --git a/examples/example3.c b/examples/example3.c | ||
59 | index fc11c1c..ffb9042 100644 | ||
60 | --- a/examples/example3.c | ||
61 | +++ b/examples/example3.c | ||
62 | @@ -56,7 +56,7 @@ main (void) | ||
63 | |||
64 | printf ("Read string (length %ld): ", (long int) strlen (buf)); | ||
65 | for (i = 0; i < strlen (buf); i++) | ||
66 | - printf ("%02x ", buf[i] & 0xFF); | ||
67 | + printf ("%02x ", (unsigned) buf[i] & 0xFF); | ||
68 | printf ("\n"); | ||
69 | |||
70 | rc = idna_to_ascii_lz (buf, &p, 0); | ||
71 | @@ -68,7 +68,7 @@ main (void) | ||
72 | |||
73 | printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p); | ||
74 | for (i = 0; i < strlen (p); i++) | ||
75 | - printf ("%02x ", p[i] & 0xFF); | ||
76 | + printf ("%02x ", (unsigned) p[i] & 0xFF); | ||
77 | printf ("\n"); | ||
78 | |||
79 | free (p); | ||
80 | diff --git a/examples/example4.c b/examples/example4.c | ||
81 | index 1b319c9..a3315a1 100644 | ||
82 | --- a/examples/example4.c | ||
83 | +++ b/examples/example4.c | ||
84 | @@ -56,7 +56,7 @@ main (void) | ||
85 | |||
86 | printf ("Read string (length %ld): ", (long int) strlen (buf)); | ||
87 | for (i = 0; i < strlen (buf); i++) | ||
88 | - printf ("%02x ", buf[i] & 0xFF); | ||
89 | + printf ("%02x ", (unsigned) buf[i] & 0xFF); | ||
90 | printf ("\n"); | ||
91 | |||
92 | rc = idna_to_unicode_lzlz (buf, &p, 0); | ||
93 | @@ -68,7 +68,7 @@ main (void) | ||
94 | |||
95 | printf ("ACE label (length %ld): '%s'\n", (long int) strlen (p), p); | ||
96 | for (i = 0; i < strlen (p); i++) | ||
97 | - printf ("%02x ", p[i] & 0xFF); | ||
98 | + printf ("%02x ", (unsigned) p[i] & 0xFF); | ||
99 | printf ("\n"); | ||
100 | |||
101 | free (p); | ||
102 | diff --git a/examples/example5.c b/examples/example5.c | ||
103 | index df55798..29d40b9 100644 | ||
104 | --- a/examples/example5.c | ||
105 | +++ b/examples/example5.c | ||
106 | @@ -68,7 +68,7 @@ main (void) | ||
107 | |||
108 | printf ("Read string (length %ld): ", (long int) strlen (buf)); | ||
109 | for (i = 0; i < strlen (buf); i++) | ||
110 | - printf ("%02x ", buf[i] & 0xFF); | ||
111 | + printf ("%02x ", (unsigned) buf[i] & 0xFF); | ||
112 | printf ("\n"); | ||
113 | |||
114 | p = stringprep_locale_to_utf8 (buf); | ||
57 | diff --git a/src/idn.c b/src/idn.c | 115 | diff --git a/src/idn.c b/src/idn.c |
58 | index be1c7d1..68e4291 100644 | 116 | index be1c7d1..13eb3c9 100644 |
59 | --- a/src/idn.c | 117 | --- a/src/idn.c |
60 | +++ b/src/idn.c | 118 | +++ b/src/idn.c |
61 | @@ -170,7 +170,7 @@ main (int argc, char *argv[]) | 119 | @@ -419,7 +419,7 @@ main (int argc, char *argv[]) |
62 | (args_info.idna_to_unicode_given ? 1 : 0) + | 120 | size_t i; |
63 | (args_info.nfkc_given ? 1 : 0) != 1) | 121 | for (i = 0; p[i]; i++) |
122 | fprintf (stderr, "output[%lu] = U+%04x\n", | ||
123 | - (unsigned long) i, p[i]); | ||
124 | + (unsigned long) i, (unsigned) p[i]); | ||
125 | } | ||
126 | |||
127 | fprintf (stdout, "%s\n", p); | ||
128 | diff --git a/tests/tst_idna.c b/tests/tst_idna.c | ||
129 | index 415764e..4ac046f 100644 | ||
130 | --- a/tests/tst_idna.c | ||
131 | +++ b/tests/tst_idna.c | ||
132 | @@ -220,13 +220,14 @@ doit (void) | ||
133 | char label[100]; | ||
134 | uint32_t *ucs4label = NULL; | ||
135 | uint32_t tmp[100]; | ||
136 | - size_t len, len2, i; | ||
137 | + size_t len, len2; | ||
138 | int rc; | ||
139 | + unsigned i; | ||
140 | |||
141 | for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++) | ||
64 | { | 142 | { |
65 | - error (0, 0, _("only one of -s, -e, -d, -a, -u or -n can be specified")); | 143 | if (debug) |
66 | + error (0, 0, "%s", _("only one of -s, -e, -d, -a, -u or -n can be specified")); | 144 | - printf ("IDNA entry %ld: %s\n", i, idna[i].name); |
67 | usage (EXIT_FAILURE); | 145 | + printf ("IDNA entry %u: %s\n", i, idna[i].name); |
68 | } | ||
69 | 146 | ||
70 | @@ -185,7 +185,7 @@ main (int argc, char *argv[]) | 147 | if (debug) |
71 | if (!args_info.quiet_given | 148 | { |
72 | && args_info.inputs_num == 0 | 149 | @@ -237,7 +238,7 @@ doit (void) |
73 | && isatty (fileno (stdin))) | 150 | rc = idna_to_ascii_4i (idna[i].in, idna[i].inlen, label, idna[i].flags); |
74 | - fprintf (stderr, _("Type each input string on a line by itself, " | 151 | if (rc != idna[i].toasciirc) |
75 | + fprintf (stderr, "%s", _("Type each input string on a line by itself, " | 152 | { |
76 | "terminated by a newline character.\n")); | 153 | - fail ("IDNA entry %ld failed: %d\n", i, rc); |
77 | 154 | + fail ("IDNA entry %u failed: %d\n", i, rc); | |
78 | do | 155 | if (debug) |
79 | @@ -197,7 +197,7 @@ main (int argc, char *argv[]) | 156 | printf ("FATAL\n"); |
80 | if (feof (stdin)) | 157 | continue; |
81 | break; | 158 | @@ -256,7 +257,7 @@ doit (void) |
159 | if (strlen (idna[i].out) != strlen (label) || | ||
160 | strcasecmp (idna[i].out, label) != 0) | ||
161 | { | ||
162 | - fail ("IDNA entry %ld failed\n", i); | ||
163 | + fail ("IDNA entry %u failed\n", i); | ||
164 | if (debug) | ||
165 | printf ("ERROR\n"); | ||
166 | } | ||
167 | @@ -273,8 +274,8 @@ doit (void) | ||
82 | 168 | ||
83 | - error (EXIT_FAILURE, errno, _("input error")); | 169 | if (debug) |
84 | + error (EXIT_FAILURE, errno, "%s", _("input error")); | 170 | { |
171 | - printf ("in: %s (%ld==%ld)\n", idna[i].out, strlen (idna[i].out), | ||
172 | - len); | ||
173 | + printf ("in: %s (%d==%d)\n", idna[i].out, (int) strlen (idna[i].out), | ||
174 | + (int) len); | ||
175 | ucs4print (ucs4label, len); | ||
85 | } | 176 | } |
86 | 177 | ||
87 | if (strlen (line) > 0) | 178 | @@ -282,20 +283,20 @@ doit (void) |
88 | @@ -215,7 +215,7 @@ main (int argc, char *argv[]) | 179 | rc = idna_to_unicode_44i (ucs4label, len, tmp, &len2, idna[i].flags); |
89 | if (!q) | 180 | if (debug) |
181 | { | ||
182 | - printf ("expected out (%ld):\n", | ||
183 | + printf ("expected out (%lu):\n", | ||
184 | rc == IDNA_SUCCESS ? idna[i].inlen : len); | ||
185 | if (rc == IDNA_SUCCESS) | ||
186 | ucs4print (idna[i].in, idna[i].inlen); | ||
187 | else | ||
188 | ucs4print (ucs4label, len); | ||
189 | |||
190 | - printf ("computed out (%ld):\n", len2); | ||
191 | + printf ("computed out (%d):\n", (int) len2); | ||
192 | ucs4print (tmp, len2); | ||
193 | } | ||
194 | |||
195 | if (rc != idna[i].tounicoderc) | ||
196 | { | ||
197 | - fail ("IDNA entry %ld failed: %d\n", i, rc); | ||
198 | + fail ("IDNA entry %u failed: %d\n", i, rc); | ||
199 | if (debug) | ||
200 | printf ("FATAL\n"); | ||
201 | continue; | ||
202 | @@ -309,11 +310,11 @@ doit (void) | ||
203 | if (debug) | ||
90 | { | 204 | { |
91 | free (p); | 205 | if (rc == IDNA_SUCCESS) |
92 | - error (EXIT_FAILURE, 0, | 206 | - printf ("len=%ld len2=%ld\n", len2, idna[i].inlen); |
93 | + error (EXIT_FAILURE, 0, "%s", | 207 | + printf ("len=%d len2=%d\n", (int) len2, (int) idna[i].inlen); |
94 | _("could not convert from UTF-8 to UCS-4")); | 208 | else |
209 | - printf ("len=%ld len2=%ld\n", len, len2); | ||
210 | + printf ("len=%d len2=%d\n", (int) len, (int) len2); | ||
95 | } | 211 | } |
212 | - fail ("IDNA entry %ld failed\n", i); | ||
213 | + fail ("IDNA entry %u failed\n", i); | ||
214 | if (debug) | ||
215 | printf ("ERROR\n"); | ||
216 | } | ||
217 | diff --git a/tests/tst_idna2.c b/tests/tst_idna2.c | ||
218 | index 65b3a4d..38932ca 100644 | ||
219 | --- a/tests/tst_idna2.c | ||
220 | +++ b/tests/tst_idna2.c | ||
221 | @@ -461,14 +461,14 @@ static const struct idna idna[] = { | ||
222 | void | ||
223 | doit (void) | ||
224 | { | ||
225 | - size_t i; | ||
226 | + unsigned i; | ||
227 | char *out; | ||
228 | int rc; | ||
229 | |||
230 | for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++) | ||
231 | { | ||
232 | if (debug) | ||
233 | - printf ("IDNA2 entry %ld\n", i); | ||
234 | + printf ("IDNA2 entry %u\n", i); | ||
235 | |||
236 | if (debug) | ||
237 | { | ||
238 | @@ -487,7 +487,7 @@ doit (void) | ||
239 | IDNA_USE_STD3_ASCII_RULES); | ||
240 | if (rc != IDNA_SUCCESS && strlen (idna[i].out) > 0) | ||
241 | { | ||
242 | - fail ("IDNA2 entry %ld failed: %d\n", i, rc); | ||
243 | + fail ("IDNA2 entry %u failed: %d\n", i, rc); | ||
244 | continue; | ||
245 | } | ||
96 | 246 | ||
97 | @@ -240,7 +240,7 @@ main (int argc, char *argv[]) | 247 | @@ -504,7 +504,7 @@ doit (void) |
98 | if (!q) | 248 | if (strlen (idna[i].out) != strlen (out) || |
249 | strcasecmp (idna[i].out, out) != 0) | ||
99 | { | 250 | { |
100 | free (r); | 251 | - fail ("IDNA2 entry %ld failed\n", i); |
101 | - error (EXIT_FAILURE, 0, | 252 | + fail ("IDNA2 entry %u failed\n", i); |
102 | + error (EXIT_FAILURE, 0, "%s", | 253 | if (debug) |
103 | _("could not convert from UTF-8 to UCS-4")); | 254 | printf ("ERROR\n"); |
104 | } | 255 | } |
256 | diff --git a/tests/tst_idna3.c b/tests/tst_idna3.c | ||
257 | index a189378..f65628c 100644 | ||
258 | --- a/tests/tst_idna3.c | ||
259 | +++ b/tests/tst_idna3.c | ||
260 | @@ -59,13 +59,13 @@ doit (void) | ||
261 | { | ||
262 | int rc; | ||
263 | char *out = NULL; | ||
264 | - size_t i; | ||
265 | + unsigned i; | ||
266 | |||
267 | for (i = 0; i < sizeof (idna) / sizeof (idna[0]); i++) | ||
268 | { | ||
269 | rc = idna_to_unicode_8z8z (idna[i].in, &out, 0); | ||
270 | if (rc != IDNA_SUCCESS) | ||
271 | - fail ("IDNA3[%ld] failed %d\n", i, rc); | ||
272 | + fail ("IDNA3[%u] failed %d\n", i, rc); | ||
105 | 273 | ||
106 | @@ -277,7 +277,7 @@ main (int argc, char *argv[]) | 274 | if (debug && rc == IDNA_SUCCESS) |
107 | q = stringprep_utf8_to_ucs4 (p, -1, &len); | 275 | { |
108 | free (p); | 276 | @@ -75,9 +75,9 @@ doit (void) |
109 | if (!q) | 277 | } |
110 | - error (EXIT_FAILURE, 0, | 278 | |
111 | + error (EXIT_FAILURE, 0, "%s", | 279 | if (strcmp (out, idna[i].out) != 0) |
112 | _("could not convert from UTF-8 to UCS-4")); | 280 | - fail ("IDNA3[%ld] failed\n", i); |
113 | 281 | + fail ("IDNA3[%u] failed\n", i); | |
114 | if (args_info.debug_given) | 282 | else if (debug) |
115 | @@ -336,7 +336,7 @@ main (int argc, char *argv[]) | 283 | - printf ("IDNA3[%ld] success\n", i); |
116 | r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL); | 284 | + printf ("IDNA3[%u] success\n", i); |
117 | free (q); | 285 | |
118 | if (!r) | 286 | if (out) |
119 | - error (EXIT_FAILURE, 0, | 287 | idn_free (out); |
120 | + error (EXIT_FAILURE, 0, "%s", | 288 | diff --git a/tests/tst_nfkc.c b/tests/tst_nfkc.c |
121 | _("could not convert from UCS-4 to UTF-8")); | 289 | index d150fec..f5af9c6 100644 |
122 | 290 | --- a/tests/tst_nfkc.c | |
123 | p = stringprep_utf8_to_locale (r); | 291 | +++ b/tests/tst_nfkc.c |
124 | @@ -360,7 +360,7 @@ main (int argc, char *argv[]) | 292 | @@ -68,18 +68,18 @@ void |
125 | q = stringprep_utf8_to_ucs4 (p, -1, NULL); | 293 | doit (void) |
126 | free (p); | 294 | { |
127 | if (!q) | 295 | char *out; |
128 | - error (EXIT_FAILURE, 0, | 296 | - size_t i; |
129 | + error (EXIT_FAILURE, 0, "%s", | 297 | + unsigned i; |
130 | _("could not convert from UCS-4 to UTF-8")); | 298 | |
131 | 299 | for (i = 0; i < sizeof (nfkc) / sizeof (nfkc[0]); i++) | |
132 | if (args_info.debug_given) | 300 | { |
133 | @@ -438,7 +438,7 @@ main (int argc, char *argv[]) | 301 | if (debug) |
134 | if (!q) | 302 | - printf ("NFKC entry %ld\n", i); |
303 | + printf ("NFKC entry %u\n", i); | ||
304 | |||
305 | out = stringprep_utf8_nfkc_normalize (nfkc[i].in, | ||
306 | (ssize_t) strlen (nfkc[i].in)); | ||
307 | if (out == NULL) | ||
308 | { | ||
309 | - fail ("NFKC entry %ld failed fatally\n", i); | ||
310 | + fail ("NFKC entry %u failed fatally\n", i); | ||
311 | continue; | ||
312 | } | ||
313 | |||
314 | @@ -114,7 +114,7 @@ doit (void) | ||
315 | if (strlen (nfkc[i].out) != strlen (out) || | ||
316 | memcmp (nfkc[i].out, out, strlen (out)) != 0) | ||
317 | { | ||
318 | - fail ("NFKC entry %ld failed\n", i); | ||
319 | + fail ("NFKC entry %u failed\n", i); | ||
320 | if (debug) | ||
321 | printf ("ERROR\n"); | ||
322 | } | ||
323 | diff --git a/tests/tst_pr29.c b/tests/tst_pr29.c | ||
324 | index 3dc5466..11d0ede 100644 | ||
325 | --- a/tests/tst_pr29.c | ||
326 | +++ b/tests/tst_pr29.c | ||
327 | @@ -91,7 +91,7 @@ static const struct tv tv[] = { | ||
328 | void | ||
329 | doit (void) | ||
330 | { | ||
331 | - size_t i; | ||
332 | + unsigned i; | ||
333 | int rc; | ||
334 | |||
335 | for (i = 0; i < sizeof (tv) / sizeof (tv[0]); i++) | ||
336 | @@ -100,7 +100,7 @@ doit (void) | ||
337 | { | ||
338 | uint32_t *p, *q; | ||
339 | |||
340 | - printf ("PR29 entry %ld: %s\n", i, tv[i].name); | ||
341 | + printf ("PR29 entry %u: %s\n", i, tv[i].name); | ||
342 | |||
343 | printf ("in:\n"); | ||
344 | ucs4print (tv[i].in, tv[i].inlen); | ||
345 | @@ -120,7 +120,7 @@ doit (void) | ||
346 | rc = pr29_4 (tv[i].in, tv[i].inlen); | ||
347 | if (rc != tv[i].rc) | ||
348 | { | ||
349 | - fail ("PR29 entry %ld failed (expected %d): %d\n", i, tv[i].rc, rc); | ||
350 | + fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc, rc); | ||
351 | if (debug) | ||
352 | printf ("FATAL\n"); | ||
353 | continue; | ||
354 | @@ -129,7 +129,7 @@ doit (void) | ||
355 | rc = pr29_4z (tv[i].in); | ||
356 | if (rc != tv[i].rc) | ||
357 | { | ||
358 | - fail ("PR29 entry %ld failed (expected %d): %d\n", i, tv[i].rc, rc); | ||
359 | + fail ("PR29 entry %u failed (expected %d): %d\n", i, tv[i].rc, rc); | ||
360 | if (debug) | ||
361 | printf ("FATAL\n"); | ||
362 | continue; | ||
363 | @@ -142,7 +142,7 @@ doit (void) | ||
364 | p = stringprep_ucs4_to_utf8 (tv[i].in, (ssize_t) tv[i].inlen, | ||
365 | &items_read, &items_written); | ||
366 | if (p == NULL) | ||
367 | - fail ("FAIL: stringprep_ucs4_to_utf8(tv[%ld]) == NULL\n", i); | ||
368 | + fail ("FAIL: stringprep_ucs4_to_utf8(tv[%u]) == NULL\n", i); | ||
369 | if (debug) | ||
370 | hexprint (p, strlen (p)); | ||
371 | |||
372 | @@ -150,7 +150,7 @@ doit (void) | ||
373 | free (p); | ||
374 | if (rc != tv[i].rc) | ||
375 | { | ||
376 | - fail ("PR29 entry %ld failed (expected %d): %d\n", | ||
377 | + fail ("PR29 entry %u failed (expected %d): %d\n", | ||
378 | i, tv[i].rc, rc); | ||
379 | if (debug) | ||
380 | printf ("FATAL\n"); | ||
381 | diff --git a/tests/tst_punycode.c b/tests/tst_punycode.c | ||
382 | index 493b8a2..997744a 100644 | ||
383 | --- a/tests/tst_punycode.c | ||
384 | +++ b/tests/tst_punycode.c | ||
385 | @@ -173,7 +173,8 @@ doit (void) | ||
386 | char *p; | ||
387 | uint32_t *q; | ||
388 | int rc; | ||
389 | - size_t i, outlen; | ||
390 | + size_t outlen; | ||
391 | + unsigned i; | ||
392 | |||
393 | p = malloc (sizeof (*p) * BUFSIZ); | ||
394 | if (p == NULL) | ||
395 | @@ -186,7 +187,7 @@ doit (void) | ||
396 | for (i = 0; i < sizeof (punycode) / sizeof (punycode[0]); i++) | ||
397 | { | ||
398 | if (debug) | ||
399 | - printf ("PUNYCODE entry %ld: %s\n", i, punycode[i].name); | ||
400 | + printf ("PUNYCODE entry %u: %s\n", i, punycode[i].name); | ||
401 | |||
402 | if (debug) | ||
403 | { | ||
404 | @@ -199,7 +200,7 @@ doit (void) | ||
405 | NULL, &outlen, p); | ||
406 | if (rc != punycode[i].rc) | ||
407 | { | ||
408 | - fail ("punycode_encode() entry %ld failed: %d\n", i, rc); | ||
409 | + fail ("punycode_encode() entry %u failed: %d\n", i, rc); | ||
410 | if (debug) | ||
411 | printf ("FATAL\n"); | ||
412 | continue; | ||
413 | @@ -221,7 +222,7 @@ doit (void) | ||
414 | if (strlen (punycode[i].out) != strlen (p) || | ||
415 | memcmp (punycode[i].out, p, strlen (p)) != 0) | ||
416 | { | ||
417 | - fail ("punycode() entry %ld failed\n", i); | ||
418 | + fail ("punycode() entry %u failed\n", i); | ||
419 | if (debug) | ||
420 | printf ("ERROR\n"); | ||
421 | } | ||
422 | @@ -241,7 +242,7 @@ doit (void) | ||
423 | &outlen, q, NULL); | ||
424 | if (rc != punycode[i].rc) | ||
425 | { | ||
426 | - fail ("punycode() entry %ld failed: %d\n", i, rc); | ||
427 | + fail ("punycode() entry %u failed: %d\n", i, rc); | ||
428 | if (debug) | ||
429 | printf ("FATAL\n"); | ||
430 | continue; | ||
431 | @@ -262,7 +263,7 @@ doit (void) | ||
432 | if (punycode[i].inlen != outlen || | ||
433 | memcmp (punycode[i].in, q, outlen) != 0) | ||
135 | { | 434 | { |
136 | free (p); | 435 | - fail ("punycode_decode() entry %ld failed\n", i); |
137 | - error (EXIT_FAILURE, 0, | 436 | + fail ("punycode_decode() entry %u failed\n", i); |
138 | + error (EXIT_FAILURE, 0, "%s", | 437 | if (debug) |
139 | _("could not convert from UCS-4 to UTF-8")); | 438 | printf ("ERROR\n"); |
140 | } | 439 | } |
440 | diff --git a/tests/tst_strerror.c b/tests/tst_strerror.c | ||
441 | index 71fff59..730f5e4 100644 | ||
442 | --- a/tests/tst_strerror.c | ||
443 | +++ b/tests/tst_strerror.c | ||
444 | @@ -110,7 +110,7 @@ doit (void) | ||
445 | /* Iterate through all error codes. */ | ||
446 | |||
447 | { | ||
448 | - size_t i; | ||
449 | + unsigned i; | ||
450 | const char *last_p = NULL; | ||
451 | |||
452 | for (i = 0;; i++) | ||
453 | @@ -126,13 +126,13 @@ doit (void) | ||
454 | break; | ||
455 | } | ||
456 | if (debug) | ||
457 | - printf ("idna %ld: %s\n", i, p); | ||
458 | + printf ("idna %u: %s\n", i, p); | ||
459 | last_p = p; | ||
460 | } | ||
461 | } | ||
462 | |||
463 | { | ||
464 | - size_t i; | ||
465 | + unsigned i; | ||
466 | const char *last_p = NULL; | ||
467 | |||
468 | for (i = 0;; i++) | ||
469 | @@ -141,13 +141,13 @@ doit (void) | ||
470 | if (p == last_p) | ||
471 | break; | ||
472 | if (debug) | ||
473 | - printf ("pr29 %ld: %s\n", i, p); | ||
474 | + printf ("pr29 %u: %s\n", i, p); | ||
475 | last_p = p; | ||
476 | } | ||
477 | } | ||
478 | |||
479 | { | ||
480 | - size_t i; | ||
481 | + unsigned i; | ||
482 | const char *last_p = NULL; | ||
483 | |||
484 | for (i = 0;; i++) | ||
485 | @@ -156,13 +156,13 @@ doit (void) | ||
486 | if (p == last_p) | ||
487 | break; | ||
488 | if (debug) | ||
489 | - printf ("punycode %ld: %s\n", i, p); | ||
490 | + printf ("punycode %u: %s\n", i, p); | ||
491 | last_p = p; | ||
492 | } | ||
493 | } | ||
141 | 494 | ||
142 | @@ -494,7 +494,7 @@ main (int argc, char *argv[]) | 495 | { |
143 | r = stringprep_ucs4_to_utf8 (q, -1, NULL, NULL); | 496 | - size_t i; |
144 | free (q); | 497 | + unsigned i; |
145 | if (!r) | 498 | const char *last_p = NULL; |
146 | - error (EXIT_FAILURE, 0, | 499 | |
147 | + error (EXIT_FAILURE, 0, "%s", | 500 | for (i = 0;; i++) |
148 | _("could not convert from UTF-8 to UCS-4")); | 501 | @@ -183,13 +183,13 @@ doit (void) |
149 | 502 | break; | |
150 | p = stringprep_utf8_to_locale (r); | 503 | } |
151 | @@ -523,7 +523,7 @@ main (int argc, char *argv[]) | 504 | if (debug) |
152 | if (!q) | 505 | - printf ("stringprep %ld: %s\n", i, p); |
153 | { | 506 | + printf ("stringprep %u: %s\n", i, p); |
154 | free (p); | 507 | last_p = p; |
155 | - error (EXIT_FAILURE, 0, | 508 | } |
156 | + error (EXIT_FAILURE, 0, "%s", | 509 | } |
157 | _("could not convert from UTF-8 to UCS-4")); | 510 | |
158 | } | 511 | { |
159 | 512 | - size_t i; | |
160 | @@ -537,7 +537,8 @@ main (int argc, char *argv[]) | 513 | + unsigned i; |
161 | r = stringprep_utf8_nfkc_normalize (p, -1); | 514 | const char *last_p = NULL; |
162 | free (p); | 515 | |
163 | if (!r) | 516 | for (i = 0;; i++) |
164 | - error (EXIT_FAILURE, 0, _("could not do NFKC normalization")); | 517 | @@ -198,7 +198,7 @@ doit (void) |
165 | + error (EXIT_FAILURE, 0, "%s", | 518 | if (p == last_p) |
166 | + _("could not do NFKC normalization")); | 519 | break; |
167 | 520 | if (debug) | |
168 | if (args_info.debug_given) | 521 | - printf ("tld %ld: %s\n", i, p); |
522 | + printf ("tld %u: %s\n", i, p); | ||
523 | last_p = p; | ||
524 | } | ||
525 | } | ||
526 | diff --git a/tests/tst_stringprep.c b/tests/tst_stringprep.c | ||
527 | index 149ce6f..7c9ab06 100644 | ||
528 | --- a/tests/tst_stringprep.c | ||
529 | +++ b/tests/tst_stringprep.c | ||
530 | @@ -205,7 +205,7 @@ doit (void) | ||
531 | { | ||
532 | char *p; | ||
533 | int rc; | ||
534 | - size_t i; | ||
535 | + unsigned i; | ||
536 | |||
537 | if (!stringprep_check_version (STRINGPREP_VERSION)) | ||
538 | fail ("stringprep_check_version failed (header %s runtime %s)\n", | ||
539 | @@ -224,7 +224,7 @@ doit (void) | ||
540 | for (i = 0; i < sizeof (strprep) / sizeof (strprep[0]); i++) | ||
541 | { | ||
542 | if (debug) | ||
543 | - printf ("STRINGPREP entry %ld\n", i); | ||
544 | + printf ("STRINGPREP entry %u\n", i); | ||
545 | |||
546 | if (debug) | ||
547 | { | ||
548 | @@ -247,12 +247,12 @@ doit (void) | ||
549 | continue; | ||
550 | else if (l == NULL) | ||
551 | { | ||
552 | - fail ("bad UTF-8 in entry %ld\n", i); | ||
553 | + fail ("bad UTF-8 in entry %u\n", i); | ||
554 | continue; | ||
555 | } | ||
556 | else if (strcmp (strprep[i].in, x) != 0) | ||
557 | { | ||
558 | - fail ("bad UTF-8 in entry %ld\n", i); | ||
559 | + fail ("bad UTF-8 in entry %u\n", i); | ||
560 | if (debug) | ||
561 | { | ||
562 | puts ("expected:"); | ||
563 | @@ -274,7 +274,7 @@ doit (void) | ||
564 | "Nameprep", strprep[i].flags); | ||
565 | if (rc != strprep[i].rc) | ||
566 | { | ||
567 | - fail ("stringprep() entry %ld failed: %d\n", i, rc); | ||
568 | + fail ("stringprep() entry %u failed: %d\n", i, rc); | ||
569 | if (debug) | ||
570 | printf ("FATAL\n"); | ||
571 | if (rc == STRINGPREP_OK) | ||
572 | @@ -302,7 +302,7 @@ doit (void) | ||
573 | if (strlen (strprep[i].out) != strlen (p) || | ||
574 | memcmp (strprep[i].out, p, strlen (p)) != 0) | ||
169 | { | 575 | { |
170 | @@ -547,7 +548,7 @@ main (int argc, char *argv[]) | 576 | - fail ("stringprep() entry %ld failed\n", i); |
171 | if (!q) | 577 | + fail ("stringprep() entry %ld failed\n", (long) i); |
172 | { | 578 | if (debug) |
173 | free (r); | 579 | printf ("ERROR\n"); |
174 | - error (EXIT_FAILURE, 0, | 580 | } |
175 | + error (EXIT_FAILURE, 0, "%s", | 581 | diff --git a/tests/tst_tld.c b/tests/tst_tld.c |
176 | _("could not convert from UTF-8 to UCS-4")); | 582 | index 2f8e12e..d038c79 100644 |
177 | } | 583 | --- a/tests/tst_tld.c |
584 | +++ b/tests/tst_tld.c | ||
585 | @@ -80,7 +80,7 @@ const Tld_table * my_tld_tables[] = | ||
586 | void | ||
587 | doit (void) | ||
588 | { | ||
589 | - size_t i; | ||
590 | + unsigned i; | ||
591 | const Tld_table *tldtable; | ||
592 | char *out; | ||
593 | size_t errpos; | ||
594 | @@ -206,7 +206,7 @@ doit (void) | ||
595 | for (i = 0; i < sizeof (tld) / sizeof (tld[0]); i++) | ||
596 | { | ||
597 | if (debug) | ||
598 | - printf ("TLD entry %ld: %s\n", i, tld[i].name); | ||
599 | + printf ("TLD entry %u: %s\n", i, tld[i].name); | ||
600 | |||
601 | if (debug) | ||
602 | { | ||
603 | @@ -217,7 +217,7 @@ doit (void) | ||
604 | tldtable = tld_default_table (tld[i].tld, NULL); | ||
605 | if (tldtable == NULL) | ||
606 | { | ||
607 | - fail ("TLD entry %ld tld_get_table (%s)\n", i, tld[i].tld); | ||
608 | + fail ("TLD entry %u tld_get_table (%s)\n", i, tld[i].tld); | ||
609 | if (debug) | ||
610 | printf ("FATAL\n"); | ||
611 | continue; | ||
612 | @@ -226,7 +226,7 @@ doit (void) | ||
613 | rc = tld_check_4t (tld[i].in, tld[i].inlen, &errpos, tldtable); | ||
614 | if (rc != tld[i].rc) | ||
615 | { | ||
616 | - fail ("TLD entry %ld failed: %d\n", i, rc); | ||
617 | + fail ("TLD entry %u failed: %d\n", i, rc); | ||
618 | if (debug) | ||
619 | printf ("FATAL\n"); | ||
620 | continue; | ||
621 | @@ -237,7 +237,7 @@ doit (void) | ||
178 | 622 | ||
623 | if (rc != tld[i].rc) | ||
624 | { | ||
625 | - fail ("TLD entry %ld failed\n", i); | ||
626 | + fail ("TLD entry %u failed\n", i); | ||
627 | if (debug) | ||
628 | printf ("ERROR\n"); | ||
629 | } | ||
630 | @@ -245,12 +245,12 @@ doit (void) | ||
631 | { | ||
632 | if (debug) | ||
633 | printf ("returned errpos %ld expected errpos %ld\n", | ||
634 | - errpos, tld[i].errpos); | ||
635 | + (long) errpos, (long) tld[i].errpos); | ||
636 | |||
637 | if (tld[i].errpos != errpos) | ||
638 | { | ||
639 | - fail ("TLD entry %ld failed because errpos %ld != %ld\n", i, | ||
640 | - tld[i].errpos, errpos); | ||
641 | + fail ("TLD entry %u failed because errpos %ld != %ld\n", i, | ||
642 | + (long) tld[i].errpos, (long) errpos); | ||
643 | if (debug) | ||
644 | printf ("ERROR\n"); | ||
645 | } | ||
646 | @@ -262,12 +262,12 @@ doit (void) | ||
647 | rc = tld_check_8z (tld[i].example, &errpos, NULL); | ||
648 | if (rc != tld[i].rc) | ||
649 | { | ||
650 | - fail ("TLD entry %ld failed\n", i); | ||
651 | + fail ("TLD entry %u failed\n", i); | ||
652 | if (debug) | ||
653 | printf ("ERROR\n"); | ||
654 | } | ||
655 | if (debug) | ||
656 | - printf ("TLD entry %ld tld_check_8z (%s)\n", i, tld[i].example); | ||
657 | + printf ("TLD entry %u tld_check_8z (%s)\n", i, tld[i].example); | ||
658 | } | ||
659 | } | ||
660 | } | ||
661 | diff --git a/tests/utils.c b/tests/utils.c | ||
662 | index 717ee01..5577dc3 100644 | ||
663 | --- a/tests/utils.c | ||
664 | +++ b/tests/utils.c | ||
665 | @@ -49,7 +49,7 @@ escapeprint (const char *str, size_t len) | ||
666 | { | ||
667 | size_t i; | ||
668 | |||
669 | - printf (" (length %ld bytes):\n\t", len); | ||
670 | + printf (" (length %ld bytes):\n\t", (long) len); | ||
671 | for (i = 0; i < len; i++) | ||
672 | { | ||
673 | if (((str[i] & 0xFF) >= 'A' && (str[i] & 0xFF) <= 'Z') || | ||
674 | @@ -58,7 +58,7 @@ escapeprint (const char *str, size_t len) | ||
675 | || (str[i] & 0xFF) == ' ' || (str[i] & 0xFF) == '.') | ||
676 | printf ("%c", (str[i] & 0xFF)); | ||
677 | else | ||
678 | - printf ("\\x%02X", (str[i] & 0xFF)); | ||
679 | + printf ("\\x%02X", (unsigned) (str[i] & 0xFF)); | ||
680 | if ((i + 1) % 16 == 0 && (i + 1) < len) | ||
681 | printf ("'\n\t'"); | ||
682 | } | ||
683 | @@ -73,7 +73,7 @@ hexprint (const char *str, size_t len) | ||
684 | printf ("\t;; "); | ||
685 | for (i = 0; i < len; i++) | ||
686 | { | ||
687 | - printf ("%02x ", (str[i] & 0xFF)); | ||
688 | + printf ("%02x ", (unsigned) (str[i] & 0xFF)); | ||
689 | if ((i + 1) % 8 == 0) | ||
690 | printf (" "); | ||
691 | if ((i + 1) % 16 == 0 && i + 1 < len) | ||
179 | -- | 692 | -- |
180 | 2.8.1 | 693 | 1.9.1 |
181 | 694 | ||
diff --git a/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch b/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch new file mode 100644 index 0000000000..546a6eaafc --- /dev/null +++ b/meta/recipes-extended/libidn/libidn/gcc7-compatibility.patch | |||
@@ -0,0 +1,334 @@ | |||
1 | From 230930b3bc3e431b819eb45420cb42475d83ca93 Mon Sep 17 00:00:00 2001 | ||
2 | From: =?utf8?q?Tim=20R=C3=BChsen?= <tim.ruehsen@gmx.de> | ||
3 | Date: Wed, 1 Feb 2017 10:44:36 +0100 | ||
4 | Subject: [PATCH] Update intprops.h for gcc-7 compatibility | ||
5 | |||
6 | --- | ||
7 | Upstream-Status: Backport | ||
8 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
9 | |||
10 | gl/intprops.h | 65 ++++++++++++++++++++++++++++++-------------------- | ||
11 | lib/gltests/intprops.h | 65 ++++++++++++++++++++++++++++++-------------------- | ||
12 | 2 files changed, 78 insertions(+), 52 deletions(-) | ||
13 | |||
14 | diff --git a/gl/intprops.h b/gl/intprops.h | ||
15 | index e1fce5c..eb06b69 100644 | ||
16 | --- a/gl/intprops.h | ||
17 | +++ b/gl/intprops.h | ||
18 | @@ -1,18 +1,18 @@ | ||
19 | /* intprops.h -- properties of integer types | ||
20 | |||
21 | - Copyright (C) 2001-2016 Free Software Foundation, Inc. | ||
22 | + Copyright (C) 2001-2017 Free Software Foundation, Inc. | ||
23 | |||
24 | This program is free software: you can redistribute it and/or modify it | ||
25 | - under the terms of the GNU General Public License as published | ||
26 | - by the Free Software Foundation; either version 3 of the License, or | ||
27 | + under the terms of the GNU Lesser General Public License as published | ||
28 | + by the Free Software Foundation; either version 2.1 of the License, or | ||
29 | (at your option) any later version. | ||
30 | |||
31 | This program is distributed in the hope that it will be useful, | ||
32 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
33 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
34 | - GNU General Public License for more details. | ||
35 | + GNU Lesser General Public License for more details. | ||
36 | |||
37 | - You should have received a copy of the GNU General Public License | ||
38 | + You should have received a copy of the GNU Lesser General Public License | ||
39 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
40 | |||
41 | /* Written by Paul Eggert. */ | ||
42 | @@ -47,12 +47,16 @@ | ||
43 | |||
44 | /* Minimum and maximum values for integer types and expressions. */ | ||
45 | |||
46 | +/* The width in bits of the integer type or expression T. | ||
47 | + Padding bits are not supported; this is checked at compile-time below. */ | ||
48 | +#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) | ||
49 | + | ||
50 | /* The maximum and minimum values for the integer type T. */ | ||
51 | #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) | ||
52 | #define TYPE_MAXIMUM(t) \ | ||
53 | ((t) (! TYPE_SIGNED (t) \ | ||
54 | ? (t) -1 \ | ||
55 | - : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) | ||
56 | + : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) | ||
57 | |||
58 | /* The maximum and minimum values for the type of the expression E, | ||
59 | after integer promotion. E should not have side effects. */ | ||
60 | @@ -65,7 +69,13 @@ | ||
61 | ? _GL_SIGNED_INT_MAXIMUM (e) \ | ||
62 | : _GL_INT_NEGATE_CONVERT (e, 1)) | ||
63 | #define _GL_SIGNED_INT_MAXIMUM(e) \ | ||
64 | - (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1) | ||
65 | + (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) | ||
66 | + | ||
67 | +/* Work around OpenVMS incompatibility with C99. */ | ||
68 | +#if !defined LLONG_MAX && defined __INT64_MAX | ||
69 | +# define LLONG_MAX __INT64_MAX | ||
70 | +# define LLONG_MIN __INT64_MIN | ||
71 | +#endif | ||
72 | |||
73 | /* This include file assumes that signed types are two's complement without | ||
74 | padding bits; the above macros have undefined behavior otherwise. | ||
75 | @@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX); | ||
76 | verify (TYPE_MINIMUM (long long int) == LLONG_MIN); | ||
77 | verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
78 | #endif | ||
79 | +/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined. */ | ||
80 | +#ifdef UINT_WIDTH | ||
81 | +verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH); | ||
82 | +#endif | ||
83 | |||
84 | /* Does the __typeof__ keyword work? This could be done by | ||
85 | 'configure', but for now it's easier to do it by hand. */ | ||
86 | -#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ | ||
87 | +#if (2 <= __GNUC__ \ | ||
88 | + || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ | ||
89 | || (0x5110 <= __SUNPRO_C && !__STDC__)) | ||
90 | # define _GL_HAVE___TYPEOF__ 1 | ||
91 | #else | ||
92 | @@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
93 | signed, this macro may overestimate the true bound by one byte when | ||
94 | applied to unsigned types of size 2, 4, 16, ... bytes. */ | ||
95 | #define INT_STRLEN_BOUND(t) \ | ||
96 | - (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \ | ||
97 | - - _GL_SIGNED_TYPE_OR_EXPR (t)) \ | ||
98 | + (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \ | ||
99 | + _GL_SIGNED_TYPE_OR_EXPR (t)) | ||
100 | |||
101 | /* Bound on buffer size needed to represent an integer type or expression T, | ||
102 | @@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
103 | ? (a) < (min) >> (b) \ | ||
104 | : (max) >> (b) < (a)) | ||
105 | |||
106 | -/* True if __builtin_add_overflow (A, B, P) works when P is null. */ | ||
107 | -#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__) | ||
108 | +/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */ | ||
109 | +#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__) | ||
110 | + | ||
111 | +/* True if __builtin_add_overflow_p (A, B, C) works. */ | ||
112 | +#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) | ||
113 | |||
114 | /* The _GL*_OVERFLOW macros have the same restrictions as the | ||
115 | *_RANGE_OVERFLOW macros, except that they do not assume that operands | ||
116 | (e.g., A and B) have the same type as MIN and MAX. Instead, they assume | ||
117 | that the result (e.g., A + B) has that type. */ | ||
118 | -#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL | ||
119 | -# define _GL_ADD_OVERFLOW(a, b, min, max) | ||
120 | - __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0) | ||
121 | -# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) | ||
122 | - __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0) | ||
123 | -# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) | ||
124 | - __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0) | ||
125 | +#if _GL_HAS_BUILTIN_OVERFLOW_P | ||
126 | +# define _GL_ADD_OVERFLOW(a, b, min, max) \ | ||
127 | + __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0) | ||
128 | +# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \ | ||
129 | + __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0) | ||
130 | +# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \ | ||
131 | + __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0) | ||
132 | #else | ||
133 | # define _GL_ADD_OVERFLOW(a, b, min, max) \ | ||
134 | ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \ | ||
135 | @@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
136 | _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW) | ||
137 | #define INT_SUBTRACT_OVERFLOW(a, b) \ | ||
138 | _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW) | ||
139 | -#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL | ||
140 | +#if _GL_HAS_BUILTIN_OVERFLOW_P | ||
141 | # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a) | ||
142 | #else | ||
143 | # define INT_NEGATE_OVERFLOW(a) \ | ||
144 | @@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
145 | #define INT_MULTIPLY_WRAPV(a, b, r) \ | ||
146 | _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW) | ||
147 | |||
148 | -#ifndef __has_builtin | ||
149 | -# define __has_builtin(x) 0 | ||
150 | -#endif | ||
151 | - | ||
152 | /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: | ||
153 | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 | ||
154 | https://llvm.org/bugs/show_bug.cgi?id=25390 | ||
155 | @@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
156 | the operation. BUILTIN is the builtin operation, and OVERFLOW the | ||
157 | overflow predicate. Return 1 if the result overflows. See above | ||
158 | for restrictions. */ | ||
159 | -#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow) | ||
160 | +#if _GL_HAS_BUILTIN_OVERFLOW | ||
161 | # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r) | ||
162 | #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS | ||
163 | # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ | ||
164 | @@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
165 | # else | ||
166 | # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ | ||
167 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ | ||
168 | - long int, LONG_MIN, LONG_MAX)) | ||
169 | + long int, LONG_MIN, LONG_MAX) | ||
170 | # endif | ||
171 | #endif | ||
172 | |||
173 | diff --git a/lib/gltests/intprops.h b/lib/gltests/intprops.h | ||
174 | index e1fce5c..eb06b69 100644 | ||
175 | --- a/lib/gltests/intprops.h | ||
176 | +++ b/lib/gltests/intprops.h | ||
177 | @@ -1,18 +1,18 @@ | ||
178 | /* intprops.h -- properties of integer types | ||
179 | |||
180 | - Copyright (C) 2001-2016 Free Software Foundation, Inc. | ||
181 | + Copyright (C) 2001-2017 Free Software Foundation, Inc. | ||
182 | |||
183 | This program is free software: you can redistribute it and/or modify it | ||
184 | - under the terms of the GNU General Public License as published | ||
185 | - by the Free Software Foundation; either version 3 of the License, or | ||
186 | + under the terms of the GNU Lesser General Public License as published | ||
187 | + by the Free Software Foundation; either version 2.1 of the License, or | ||
188 | (at your option) any later version. | ||
189 | |||
190 | This program is distributed in the hope that it will be useful, | ||
191 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
192 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
193 | - GNU General Public License for more details. | ||
194 | + GNU Lesser General Public License for more details. | ||
195 | |||
196 | - You should have received a copy of the GNU General Public License | ||
197 | + You should have received a copy of the GNU Lesser General Public License | ||
198 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | ||
199 | |||
200 | /* Written by Paul Eggert. */ | ||
201 | @@ -47,12 +47,16 @@ | ||
202 | |||
203 | /* Minimum and maximum values for integer types and expressions. */ | ||
204 | |||
205 | +/* The width in bits of the integer type or expression T. | ||
206 | + Padding bits are not supported; this is checked at compile-time below. */ | ||
207 | +#define TYPE_WIDTH(t) (sizeof (t) * CHAR_BIT) | ||
208 | + | ||
209 | /* The maximum and minimum values for the integer type T. */ | ||
210 | #define TYPE_MINIMUM(t) ((t) ~ TYPE_MAXIMUM (t)) | ||
211 | #define TYPE_MAXIMUM(t) \ | ||
212 | ((t) (! TYPE_SIGNED (t) \ | ||
213 | ? (t) -1 \ | ||
214 | - : ((((t) 1 << (sizeof (t) * CHAR_BIT - 2)) - 1) * 2 + 1))) | ||
215 | + : ((((t) 1 << (TYPE_WIDTH (t) - 2)) - 1) * 2 + 1))) | ||
216 | |||
217 | /* The maximum and minimum values for the type of the expression E, | ||
218 | after integer promotion. E should not have side effects. */ | ||
219 | @@ -65,7 +69,13 @@ | ||
220 | ? _GL_SIGNED_INT_MAXIMUM (e) \ | ||
221 | : _GL_INT_NEGATE_CONVERT (e, 1)) | ||
222 | #define _GL_SIGNED_INT_MAXIMUM(e) \ | ||
223 | - (((_GL_INT_CONVERT (e, 1) << (sizeof ((e) + 0) * CHAR_BIT - 2)) - 1) * 2 + 1) | ||
224 | + (((_GL_INT_CONVERT (e, 1) << (TYPE_WIDTH ((e) + 0) - 2)) - 1) * 2 + 1) | ||
225 | + | ||
226 | +/* Work around OpenVMS incompatibility with C99. */ | ||
227 | +#if !defined LLONG_MAX && defined __INT64_MAX | ||
228 | +# define LLONG_MAX __INT64_MAX | ||
229 | +# define LLONG_MIN __INT64_MIN | ||
230 | +#endif | ||
231 | |||
232 | /* This include file assumes that signed types are two's complement without | ||
233 | padding bits; the above macros have undefined behavior otherwise. | ||
234 | @@ -84,10 +94,15 @@ verify (TYPE_MAXIMUM (long int) == LONG_MAX); | ||
235 | verify (TYPE_MINIMUM (long long int) == LLONG_MIN); | ||
236 | verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
237 | #endif | ||
238 | +/* Similarly, sanity-check one ISO/IEC TS 18661-1:2014 macro if defined. */ | ||
239 | +#ifdef UINT_WIDTH | ||
240 | +verify (TYPE_WIDTH (unsigned int) == UINT_WIDTH); | ||
241 | +#endif | ||
242 | |||
243 | /* Does the __typeof__ keyword work? This could be done by | ||
244 | 'configure', but for now it's easier to do it by hand. */ | ||
245 | -#if (2 <= __GNUC__ || defined __IBM__TYPEOF__ \ | ||
246 | +#if (2 <= __GNUC__ \ | ||
247 | + || (1210 <= __IBMC__ && defined __IBM__TYPEOF__) \ | ||
248 | || (0x5110 <= __SUNPRO_C && !__STDC__)) | ||
249 | # define _GL_HAVE___TYPEOF__ 1 | ||
250 | #else | ||
251 | @@ -116,8 +131,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
252 | signed, this macro may overestimate the true bound by one byte when | ||
253 | applied to unsigned types of size 2, 4, 16, ... bytes. */ | ||
254 | #define INT_STRLEN_BOUND(t) \ | ||
255 | - (INT_BITS_STRLEN_BOUND (sizeof (t) * CHAR_BIT \ | ||
256 | - - _GL_SIGNED_TYPE_OR_EXPR (t)) \ | ||
257 | + (INT_BITS_STRLEN_BOUND (TYPE_WIDTH (t) - _GL_SIGNED_TYPE_OR_EXPR (t)) \ | ||
258 | + _GL_SIGNED_TYPE_OR_EXPR (t)) | ||
259 | |||
260 | /* Bound on buffer size needed to represent an integer type or expression T, | ||
261 | @@ -222,20 +236,23 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
262 | ? (a) < (min) >> (b) \ | ||
263 | : (max) >> (b) < (a)) | ||
264 | |||
265 | -/* True if __builtin_add_overflow (A, B, P) works when P is null. */ | ||
266 | -#define _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL (7 <= __GNUC__) | ||
267 | +/* True if __builtin_add_overflow (A, B, P) works when P is non-null. */ | ||
268 | +#define _GL_HAS_BUILTIN_OVERFLOW (5 <= __GNUC__) | ||
269 | + | ||
270 | +/* True if __builtin_add_overflow_p (A, B, C) works. */ | ||
271 | +#define _GL_HAS_BUILTIN_OVERFLOW_P (7 <= __GNUC__) | ||
272 | |||
273 | /* The _GL*_OVERFLOW macros have the same restrictions as the | ||
274 | *_RANGE_OVERFLOW macros, except that they do not assume that operands | ||
275 | (e.g., A and B) have the same type as MIN and MAX. Instead, they assume | ||
276 | that the result (e.g., A + B) has that type. */ | ||
277 | -#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL | ||
278 | -# define _GL_ADD_OVERFLOW(a, b, min, max) | ||
279 | - __builtin_add_overflow (a, b, (__typeof__ ((a) + (b)) *) 0) | ||
280 | -# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) | ||
281 | - __builtin_sub_overflow (a, b, (__typeof__ ((a) - (b)) *) 0) | ||
282 | -# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) | ||
283 | - __builtin_mul_overflow (a, b, (__typeof__ ((a) * (b)) *) 0) | ||
284 | +#if _GL_HAS_BUILTIN_OVERFLOW_P | ||
285 | +# define _GL_ADD_OVERFLOW(a, b, min, max) \ | ||
286 | + __builtin_add_overflow_p (a, b, (__typeof__ ((a) + (b))) 0) | ||
287 | +# define _GL_SUBTRACT_OVERFLOW(a, b, min, max) \ | ||
288 | + __builtin_sub_overflow_p (a, b, (__typeof__ ((a) - (b))) 0) | ||
289 | +# define _GL_MULTIPLY_OVERFLOW(a, b, min, max) \ | ||
290 | + __builtin_mul_overflow_p (a, b, (__typeof__ ((a) * (b))) 0) | ||
291 | #else | ||
292 | # define _GL_ADD_OVERFLOW(a, b, min, max) \ | ||
293 | ((min) < 0 ? INT_ADD_RANGE_OVERFLOW (a, b, min, max) \ | ||
294 | @@ -315,7 +332,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
295 | _GL_BINARY_OP_OVERFLOW (a, b, _GL_ADD_OVERFLOW) | ||
296 | #define INT_SUBTRACT_OVERFLOW(a, b) \ | ||
297 | _GL_BINARY_OP_OVERFLOW (a, b, _GL_SUBTRACT_OVERFLOW) | ||
298 | -#if _GL_HAS_BUILTIN_OVERFLOW_WITH_NULL | ||
299 | +#if _GL_HAS_BUILTIN_OVERFLOW_P | ||
300 | # define INT_NEGATE_OVERFLOW(a) INT_SUBTRACT_OVERFLOW (0, a) | ||
301 | #else | ||
302 | # define INT_NEGATE_OVERFLOW(a) \ | ||
303 | @@ -349,10 +366,6 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
304 | #define INT_MULTIPLY_WRAPV(a, b, r) \ | ||
305 | _GL_INT_OP_WRAPV (a, b, r, *, __builtin_mul_overflow, INT_MULTIPLY_OVERFLOW) | ||
306 | |||
307 | -#ifndef __has_builtin | ||
308 | -# define __has_builtin(x) 0 | ||
309 | -#endif | ||
310 | - | ||
311 | /* Nonzero if this compiler has GCC bug 68193 or Clang bug 25390. See: | ||
312 | https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68193 | ||
313 | https://llvm.org/bugs/show_bug.cgi?id=25390 | ||
314 | @@ -369,7 +382,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
315 | the operation. BUILTIN is the builtin operation, and OVERFLOW the | ||
316 | overflow predicate. Return 1 if the result overflows. See above | ||
317 | for restrictions. */ | ||
318 | -#if 5 <= __GNUC__ || __has_builtin (__builtin_add_overflow) | ||
319 | +#if _GL_HAS_BUILTIN_OVERFLOW | ||
320 | # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) builtin (a, b, r) | ||
321 | #elif 201112 <= __STDC_VERSION__ && !_GL__GENERIC_BOGUS | ||
322 | # define _GL_INT_OP_WRAPV(a, b, r, op, builtin, overflow) \ | ||
323 | @@ -412,7 +425,7 @@ verify (TYPE_MAXIMUM (long long int) == LLONG_MAX); | ||
324 | # else | ||
325 | # define _GL_INT_OP_WRAPV_LONGISH(a, b, r, op, overflow) \ | ||
326 | _GL_INT_OP_CALC (a, b, r, op, overflow, unsigned long int, \ | ||
327 | - long int, LONG_MIN, LONG_MAX)) | ||
328 | + long int, LONG_MIN, LONG_MAX) | ||
329 | # endif | ||
330 | #endif | ||
331 | |||
332 | -- | ||
333 | 1.9.1 | ||
334 | |||
diff --git a/meta/recipes-extended/libidn/libidn_1.33.bb b/meta/recipes-extended/libidn/libidn_1.33.bb index d3d0f557bb..109cc7f3f5 100644 --- a/meta/recipes-extended/libidn/libidn_1.33.bb +++ b/meta/recipes-extended/libidn/libidn_1.33.bb | |||
@@ -19,6 +19,7 @@ SRC_URI = "${GNU_MIRROR}/libidn/${BPN}-${PV}.tar.gz \ | |||
19 | file://avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch \ | 19 | file://avoid_AM_PROG_MKDIR_P_warning_error_with_automake_1.12.patch \ |
20 | file://dont-depend-on-help2man.patch \ | 20 | file://dont-depend-on-help2man.patch \ |
21 | file://0001-idn-fix-printf-format-security-warnings.patch \ | 21 | file://0001-idn-fix-printf-format-security-warnings.patch \ |
22 | file://gcc7-compatibility.patch \ | ||
22 | " | 23 | " |
23 | 24 | ||
24 | SRC_URI[md5sum] = "a9aa7e003665de9c82bd3f9fc6ccf308" | 25 | SRC_URI[md5sum] = "a9aa7e003665de9c82bd3f9fc6ccf308" |