Merge lp:~tyhicks/ecryptfs/fix-most-Wall-and-Wextra-warnings into lp:ecryptfs
- fix-most-Wall-and-Wextra-warnings
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 814 |
Proposed branch: | lp:~tyhicks/ecryptfs/fix-most-Wall-and-Wextra-warnings |
Merge into: | lp:ecryptfs |
Diff against target: |
615 lines (+103/-104) 17 files modified
src/libecryptfs/ecryptfs-stat.c (+1/-1) src/libecryptfs/key_management.c (+0/-1) src/libecryptfs/miscdev.c (+1/-1) src/libecryptfs/module_mgr.c (+60/-39) src/pam_ecryptfs/pam_ecryptfs.c (+0/-31) src/utils/mount.ecryptfs.c (+1/-0) src/utils/mount.ecryptfs_private.c (+10/-7) src/utils/test.c (+6/-6) tests/kernel/directory-concurrent/test.c (+1/-1) tests/kernel/enospc/test.c (+0/-1) tests/kernel/extend-file-random/test.c (+16/-2) tests/kernel/file-concurrent/test.c (+1/-1) tests/kernel/inode-race-stat/test.c (+2/-3) tests/kernel/inotify/test.c (+1/-1) tests/kernel/lp-509180/test.c (+0/-1) tests/kernel/trunc-file/test.c (+2/-7) tests/userspace/wrap-unwrap/test.c (+1/-1) |
To merge this branch: | bzr merge lp:~tyhicks/ecryptfs/fix-most-Wall-and-Wextra-warnings |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Colin Ian King (community) | Approve | ||
Review via email: mp+192913@code.launchpad.net |
Commit message
Description of the change
This is a good start towards fixing all warnings emitted when building with
the output of Saucy's `dpkg-buildflags --dump` plus '-Wall -Wextra' on amd64,
i386, and armhf.
I want to have a quiet, warning-free build so that we can use the compiler to
help a little more with catching bugs in new commits. I don't want to go as far
as enabling -Werror by default, but it'd be nice to have the option of using it
locally when developing/
What's left is:
[-Wmissing-
[-Wunused-
[-Wunused-result]
I'll fix those remaining three very soon. I just didn't get to them before
Monday rolled around.
Tyler Hicks (tyhicks) wrote : | # |
Colin Ian King (colin-king) wrote : | # |
These look good to me. I've run them through Coverity Scan too and it looks fine.
Tyler Hicks (tyhicks) wrote : | # |
I pushed one more patch, r815, that fixed a bug in r801. I typoed the overflow check conditional. I should have used UINTMAX_MAX instead of UINT_MAX.
Colin Ian King (colin-king) wrote : | # |
Ah, I didn't spot that, so much for my careful reviewing :-/
Tyler Hicks (tyhicks) wrote : | # |
The name of those macros are too easy to get switched around. I caught it out of sheer luck during my last second check before pushing.
Preview Diff
1 | === modified file 'src/libecryptfs/ecryptfs-stat.c' |
2 | --- src/libecryptfs/ecryptfs-stat.c 2013-03-13 14:52:43 +0000 |
3 | +++ src/libecryptfs/ecryptfs-stat.c 2013-10-28 17:50:31 +0000 |
4 | @@ -80,7 +80,7 @@ |
5 | char *buf, int *bytes_read) |
6 | { |
7 | int rc = 0; |
8 | - int i; |
9 | + size_t i; |
10 | uint32_t flags; |
11 | int big_endian; |
12 | |
13 | |
14 | === modified file 'src/libecryptfs/key_management.c' |
15 | --- src/libecryptfs/key_management.c 2013-10-25 19:45:09 +0000 |
16 | +++ src/libecryptfs/key_management.c 2013-10-28 17:50:31 +0000 |
17 | @@ -247,7 +247,6 @@ |
18 | int rc = 0; |
19 | ssize_t size; |
20 | int fd; |
21 | - int i; |
22 | char *p = NULL; |
23 | char decrypted_passphrase[ECRYPTFS_MAX_PASSPHRASE_BYTES + 1]; |
24 | |
25 | |
26 | === modified file 'src/libecryptfs/miscdev.c' |
27 | --- src/libecryptfs/miscdev.c 2013-10-25 19:45:09 +0000 |
28 | +++ src/libecryptfs/miscdev.c 2013-10-28 17:50:31 +0000 |
29 | @@ -153,7 +153,7 @@ |
30 | packet_len = 0; |
31 | } |
32 | miscdev_msg_data_size = (1 + 4 + packet_len_size + packet_len); |
33 | - if (miscdev_msg_data_size != read_bytes) { |
34 | + if (miscdev_msg_data_size != (size_t)read_bytes) { |
35 | rc = -EINVAL; |
36 | syslog(LOG_ERR, "%s: Invalid packet. (1 + 4 + " |
37 | "packet_len_size=[%zu] + packet_len=[%zu])=[%zu] != " |
38 | |
39 | === modified file 'src/libecryptfs/module_mgr.c' |
40 | --- src/libecryptfs/module_mgr.c 2013-10-25 19:45:09 +0000 |
41 | +++ src/libecryptfs/module_mgr.c 2013-10-28 17:50:31 +0000 |
42 | @@ -23,6 +23,8 @@ |
43 | #include <string.h> |
44 | #include <stdlib.h> |
45 | #include <stdio.h> |
46 | +#include <stdint.h> |
47 | +#include <inttypes.h> |
48 | #include "../include/ecryptfs.h" |
49 | #include "../include/decision_graph.h" |
50 | |
51 | @@ -265,8 +267,9 @@ |
52 | } else if (node->val) { |
53 | if (yn < 0) |
54 | rc = WRONG_VALUE; |
55 | - } else |
56 | + } else { |
57 | /* default: no */; |
58 | + } |
59 | out_free: |
60 | if (node->val) { |
61 | free(node->val); |
62 | @@ -389,33 +392,32 @@ |
63 | static struct supported_key_bytes { |
64 | char *cipher_name; |
65 | uint32_t key_bytes; |
66 | - uint32_t order; |
67 | } supported_key_bytes[] = { |
68 | - {"aes", 16, 1}, |
69 | - {"aes", 32, 2}, |
70 | - {"aes", 24, 3}, |
71 | - {"anubis", 16, 1}, |
72 | - {"anubis", 32, 2}, |
73 | - {"des3_ede", 24, 1}, |
74 | - {"serpent", 16, 1}, |
75 | - {"serpent", 32, 2}, |
76 | - {"tnepres", 16, 1}, |
77 | - {"tnepres", 32, 2}, |
78 | - {"tea", 16, 1}, |
79 | - {"xeta", 16, 1}, |
80 | - {"xtea", 16, 1}, |
81 | - {"cast5", 16, 1}, |
82 | - {"cast6", 16, 1}, |
83 | - {"cast6", 32, 2}, |
84 | - {"twofish", 16, 1}, |
85 | - {"twofish", 32, 2}, |
86 | - {"blowfish", 16, 1}, |
87 | - {"blowfish", 32, 2}, |
88 | - {"blowfish", 56, 2}, |
89 | - {"khazad", 16, 1}, |
90 | - {"arc4", 16, 1}, |
91 | - {"arc4", 32, 2}, |
92 | - {NULL, 0, 0} |
93 | + {"aes", 16}, |
94 | + {"aes", 32}, |
95 | + {"aes", 24}, |
96 | + {"anubis", 16}, |
97 | + {"anubis", 32}, |
98 | + {"des3_ede", 24}, |
99 | + {"serpent", 16}, |
100 | + {"serpent", 32}, |
101 | + {"tnepres", 16}, |
102 | + {"tnepres", 32}, |
103 | + {"tea", 16}, |
104 | + {"xeta", 16}, |
105 | + {"xtea", 16}, |
106 | + {"cast5", 16}, |
107 | + {"cast6", 16}, |
108 | + {"cast6", 32}, |
109 | + {"twofish", 16}, |
110 | + {"twofish", 32}, |
111 | + {"blowfish", 16}, |
112 | + {"blowfish", 32}, |
113 | + {"blowfish", 56}, |
114 | + {"khazad", 16}, |
115 | + {"arc4", 16}, |
116 | + {"arc4", 32}, |
117 | + {NULL, 0} |
118 | }; |
119 | |
120 | static int tf_ecryptfs_key_bytes(struct ecryptfs_ctx *ctx, |
121 | @@ -438,7 +440,7 @@ |
122 | } |
123 | |
124 | static int init_ecryptfs_key_bytes_param_node(char *cipher_name, |
125 | - int min, int max) |
126 | + uint32_t min, uint32_t max) |
127 | { |
128 | int i; |
129 | int rc = 0; |
130 | @@ -453,7 +455,7 @@ |
131 | |
132 | tn = &ecryptfs_key_bytes_param_node.tl[ |
133 | ecryptfs_key_bytes_param_node.num_transitions]; |
134 | - rc = asprintf(&tn->val, "%d", |
135 | + rc = asprintf(&tn->val, "%"PRIu32, |
136 | supported_key_bytes[i].key_bytes); |
137 | if (rc == -1) { |
138 | rc = -ENOMEM; |
139 | @@ -462,7 +464,7 @@ |
140 | rc = 0; |
141 | if (!ecryptfs_key_bytes_param_node.suggested_val) { |
142 | rc = asprintf(&ecryptfs_key_bytes_param_node.suggested_val, |
143 | - "%d", |
144 | + "%"PRIu32, |
145 | supported_key_bytes[i].key_bytes); |
146 | if (rc == -1) { |
147 | rc = -ENOMEM; |
148 | @@ -485,12 +487,33 @@ |
149 | return rc; |
150 | } |
151 | |
152 | +static int parse_key_bytes(uint32_t *bytes, const char *str) |
153 | +{ |
154 | + uintmax_t tmp; |
155 | + char *eptr; |
156 | + |
157 | + if (str[0] == '-') |
158 | + return -ERANGE; |
159 | + |
160 | + errno = 0; |
161 | + tmp = strtoumax(str, &eptr, 10); |
162 | + if (eptr == str) |
163 | + return -EINVAL; |
164 | + else if (tmp == UINT_MAX && errno == ERANGE) |
165 | + return -ERANGE; |
166 | + else if (tmp > UINT32_MAX) |
167 | + return -ERANGE; |
168 | + |
169 | + *bytes = (uint32_t)tmp; |
170 | + return 0; |
171 | +} |
172 | + |
173 | static int tf_ecryptfs_cipher(struct ecryptfs_ctx *ctx, struct param_node *node, |
174 | struct val_node **head, void **foo) |
175 | { |
176 | char *opt; |
177 | int rc; |
178 | - int min = 0, max = 999999; |
179 | + uint32_t min = 0, max = 999999; |
180 | struct val_node *tmp = *head, *tmpprev = NULL; |
181 | |
182 | while (tmp) { |
183 | @@ -498,18 +521,16 @@ |
184 | int popval = 0; |
185 | if (tmp->val && (strstr(tmp->val,"max_key_bytes=") != NULL) && |
186 | ((ptr=strchr(tmp->val,'=')) != NULL)) { |
187 | - char *eptr; |
188 | - max = strtol(++ptr, &eptr, 10); |
189 | - if (eptr == ptr) |
190 | - return -EINVAL; |
191 | + rc = parse_key_bytes(&max, ++ptr); |
192 | + if (rc) |
193 | + return rc; |
194 | popval = 1; |
195 | } |
196 | if (tmp->val && (strstr(tmp->val,"min_key_bytes=") != NULL) && |
197 | ((ptr=strchr(tmp->val,'=')) != NULL)) { |
198 | - char *eptr; |
199 | - min = strtol(++ptr, &eptr, 10); |
200 | - if (eptr == ptr) |
201 | - return -EINVAL; |
202 | + rc = parse_key_bytes(&min, ++ptr); |
203 | + if (rc) |
204 | + return rc; |
205 | popval = 1; |
206 | } |
207 | if (popval) { |
208 | |
209 | === modified file 'src/pam_ecryptfs/pam_ecryptfs.c' |
210 | --- src/pam_ecryptfs/pam_ecryptfs.c 2013-10-25 19:45:09 +0000 |
211 | +++ src/pam_ecryptfs/pam_ecryptfs.c 2013-10-28 17:50:31 +0000 |
212 | @@ -46,31 +46,6 @@ |
213 | |
214 | #define PRIVATE_DIR "Private" |
215 | |
216 | -static void error(const char *msg) |
217 | -{ |
218 | - syslog(LOG_ERR, "pam_ecryptfs: errno = [%i]; strerror = [%m]\n", errno); |
219 | - switch (errno) { |
220 | - case ENOKEY: |
221 | - syslog(LOG_ERR, "pam_ecryptfs: %s: Requested key not available\n", msg); |
222 | - return; |
223 | - |
224 | - case EKEYEXPIRED: |
225 | - syslog(LOG_ERR, "pam_ecryptfs: %s: Key has expired\n", msg); |
226 | - return; |
227 | - |
228 | - case EKEYREVOKED: |
229 | - syslog(LOG_ERR, "pam_ecryptfs: %s: Key has been revoked\n", msg); |
230 | - return; |
231 | - |
232 | - case EKEYREJECTED: |
233 | - syslog(LOG_ERR, "pam_ecryptfs: %s: Key was rejected by service\n", msg); |
234 | - return; |
235 | - default: |
236 | - syslog(LOG_ERR, "pam_ecryptfs: %s: Unknown key error\n", msg); |
237 | - return; |
238 | - } |
239 | -} |
240 | - |
241 | /* returns: 0 if file does not exist, 1 if it exists, <0 for error */ |
242 | static int file_exists_dotecryptfs(const char *homedir, char *filename) |
243 | { |
244 | @@ -211,8 +186,6 @@ |
245 | if ((argc == 1) |
246 | && (memcmp(argv[0], "unwrap\0", 7) == 0)) { |
247 | char *wrapped_pw_filename; |
248 | - char *unwrapped_pw_filename; |
249 | - struct stat s; |
250 | |
251 | rc = asprintf( |
252 | &wrapped_pw_filename, "%s/.ecryptfs/%s", |
253 | @@ -306,8 +279,6 @@ |
254 | char *autoumount = "auto-umount"; |
255 | struct stat s; |
256 | pid_t pid; |
257 | - struct utmp *u; |
258 | - int count = 0; |
259 | |
260 | if ((pwd = fetch_pwd(pamh)) == NULL) { |
261 | /* fetch_pwd() logged a message */ |
262 | @@ -433,7 +404,6 @@ |
263 | char *old_passphrase = NULL; |
264 | char *new_passphrase = NULL; |
265 | char *wrapped_pw_filename; |
266 | - char *name = NULL; |
267 | char salt[ECRYPTFS_SALT_SIZE]; |
268 | char salt_hex[ECRYPTFS_SALT_SIZE_HEX]; |
269 | pid_t child_pid, tmp_pid; |
270 | @@ -448,7 +418,6 @@ |
271 | uid = pwd->pw_uid; |
272 | gid = pwd->pw_gid; |
273 | homedir = pwd->pw_dir; |
274 | - name = pwd->pw_name; |
275 | } |
276 | } else { |
277 | syslog(LOG_ERR, "pam_ecryptfs: Error getting passwd info for user [%s]; rc = [%d]\n", username, rc); |
278 | |
279 | === modified file 'src/utils/mount.ecryptfs.c' |
280 | --- src/utils/mount.ecryptfs.c 2013-10-25 19:45:09 +0000 |
281 | +++ src/utils/mount.ecryptfs.c 2013-10-28 17:50:31 +0000 |
282 | @@ -33,6 +33,7 @@ |
283 | #include <sys/mount.h> |
284 | #include <sys/stat.h> |
285 | #include <sys/types.h> |
286 | +#include <sys/wait.h> |
287 | #include "ecryptfs.h" |
288 | #include "decision_graph.h" |
289 | #include "io.h" |
290 | |
291 | === modified file 'src/utils/mount.ecryptfs_private.c' |
292 | --- src/utils/mount.ecryptfs_private.c 2013-10-25 21:33:30 +0000 |
293 | +++ src/utils/mount.ecryptfs_private.c 2013-10-28 17:50:31 +0000 |
294 | @@ -30,6 +30,7 @@ |
295 | #include <sys/param.h> |
296 | #include <sys/stat.h> |
297 | #include <sys/types.h> |
298 | +#include <ctype.h> |
299 | #include <errno.h> |
300 | #include <keyutils.h> |
301 | #include <mntent.h> |
302 | @@ -51,7 +52,7 @@ |
303 | #define FSTYPE "ecryptfs" |
304 | #define TMP "/dev/shm" |
305 | |
306 | -int read_config(char *pw_dir, int uid, char *alias, char **s, char **d, char **o) { |
307 | +int read_config(char *pw_dir, uid_t uid, char *alias, char **s, char **d, char **o) { |
308 | /* Read an fstab(5) style config file */ |
309 | char *fnam; |
310 | struct stat mstat; |
311 | @@ -91,7 +92,7 @@ |
312 | *s = strdup(e->mnt_fsname); |
313 | if (!*s) |
314 | return -2; |
315 | -out: |
316 | + |
317 | return 0; |
318 | } |
319 | |
320 | @@ -138,7 +139,7 @@ |
321 | char *sig_file; |
322 | FILE *fh = NULL; |
323 | char **sig = NULL; |
324 | - int i, j; |
325 | + unsigned int i, j; |
326 | /* Construct sig file name */ |
327 | if (asprintf(&sig_file, "%s/.ecryptfs/%s.sig", pw_dir, alias) < 0) { |
328 | perror("asprintf"); |
329 | @@ -219,7 +220,7 @@ |
330 | return NULL; |
331 | } |
332 | |
333 | -int check_ownership_mnt(int uid, char **mnt) { |
334 | +int check_ownership_mnt(uid_t uid, char **mnt) { |
335 | /* Check ownership of mount point, chdir into it, and |
336 | * canonicalize the path for use in mtab updating. |
337 | * Return 0 if everything is in order, 1 on error. |
338 | @@ -260,7 +261,7 @@ |
339 | } |
340 | |
341 | |
342 | -int check_ownerships(int uid, char *path) { |
343 | +int check_ownerships(uid_t uid, char *path) { |
344 | /* Check ownership of device and mount point. |
345 | * Return 0 if everything is in order, 1 on error. |
346 | */ |
347 | @@ -372,7 +373,7 @@ |
348 | return 1; |
349 | } |
350 | |
351 | -FILE *lock_counter(char *u, int uid, char *alias) { |
352 | +FILE *lock_counter(char *u, uid_t uid, char *alias) { |
353 | char *f; |
354 | int fd; |
355 | FILE *fh; |
356 | @@ -506,7 +507,9 @@ |
357 | * c) updating /etc/mtab |
358 | */ |
359 | int main(int argc, char *argv[]) { |
360 | - int uid, gid, mounting; |
361 | + uid_t uid; |
362 | + gid_t gid; |
363 | + int mounting; |
364 | int force = 0; |
365 | struct passwd *pwd; |
366 | char *alias, *src, *dest, *opt, *opts2; |
367 | |
368 | === modified file 'src/utils/test.c' |
369 | --- src/utils/test.c 2013-10-25 19:45:09 +0000 |
370 | +++ src/utils/test.c 2013-10-28 17:50:31 +0000 |
371 | @@ -103,7 +103,7 @@ |
372 | unsigned long lower_page_idx; |
373 | int byte_offset; |
374 | int rc = 0; |
375 | - int i; |
376 | + size_t i; |
377 | |
378 | printf("Testing ecryptfs_extent_to_lwr_pg_idx_and_offset()... "); |
379 | crypt_stat.extent_size = ECRYPTFS_EXTENT_SIZE; |
380 | @@ -122,14 +122,14 @@ |
381 | if (lower_page_idx |
382 | != translation_test_vector[i].lower_page_idx) { |
383 | rc = -1; |
384 | - printf("\nError on test vector entry [%d]; " |
385 | + printf("\nError on test vector entry [%zu]; " |
386 | "lower_page_idx = [%lu]\n", i, lower_page_idx); |
387 | goto out; |
388 | } |
389 | if (byte_offset |
390 | != translation_test_vector[i].byte_offset) { |
391 | rc = -1; |
392 | - printf("\nError on test vector entry [%d]; " |
393 | + printf("\nError on test vector entry [%zd]; " |
394 | "byte offset = [%d]\n", i, byte_offset); |
395 | goto out; |
396 | } |
397 | @@ -276,13 +276,13 @@ |
398 | unsigned long extent_offset = 0; |
399 | unsigned long lower_page_idx = 0; |
400 | unsigned long prior_lower_page_idx = 0; |
401 | + unsigned int num_extents_per_page; |
402 | struct page *lower_page; |
403 | struct inode *lower_inode; |
404 | struct ecryptfs_crypt_stat *crypt_stat; |
405 | int rc = 0; |
406 | - int lower_byte_offset; |
407 | + int lower_byte_offset = 0; |
408 | int orig_byte_offset = 0; |
409 | - int num_extents_per_page; |
410 | #define ECRYPTFS_PAGE_STATE_UNREAD 0 |
411 | #define ECRYPTFS_PAGE_STATE_READ 1 |
412 | #define ECRYPTFS_PAGE_STATE_MODIFIED 2 |
413 | @@ -410,7 +410,7 @@ |
414 | int rc = 0; |
415 | unsigned long lower_size; |
416 | struct ecryptfs_crypt_stat crypt_stat; |
417 | - int i; |
418 | + size_t i; |
419 | |
420 | for (i = 0; |
421 | i < (sizeof(upper_lower_test_vector) |
422 | |
423 | === modified file 'tests/kernel/directory-concurrent/test.c' |
424 | --- tests/kernel/directory-concurrent/test.c 2012-02-02 15:04:32 +0000 |
425 | +++ tests/kernel/directory-concurrent/test.c 2013-10-28 17:50:31 +0000 |
426 | @@ -149,7 +149,7 @@ |
427 | |
428 | int test_dirs(const char *path, const int max_dirs) |
429 | { |
430 | - int i, j; |
431 | + int i; |
432 | char *filename; |
433 | size_t len = strlen(path) + 32; |
434 | int ret = TEST_PASSED; |
435 | |
436 | === modified file 'tests/kernel/enospc/test.c' |
437 | --- tests/kernel/enospc/test.c 2013-10-25 22:51:40 +0000 |
438 | +++ tests/kernel/enospc/test.c 2013-10-28 17:50:31 +0000 |
439 | @@ -38,7 +38,6 @@ |
440 | int test_exercise(char *filename, off_t size) |
441 | { |
442 | int fd; |
443 | - struct stat statbuf; |
444 | int ret = TEST_FAILED; |
445 | unsigned char buff[BUFF_SZ]; |
446 | |
447 | |
448 | === modified file 'tests/kernel/extend-file-random/test.c' |
449 | --- tests/kernel/extend-file-random/test.c 2013-10-25 23:14:23 +0000 |
450 | +++ tests/kernel/extend-file-random/test.c 2013-10-28 17:50:31 +0000 |
451 | @@ -42,32 +42,46 @@ |
452 | |
453 | int test_write(int fd, char *buffer, size_t len, off_t offset) |
454 | { |
455 | + ssize_t rc; |
456 | + |
457 | if (lseek(fd, offset, SEEK_SET) < 0) { |
458 | fprintf(stderr, "Failed to seek to position %jd: %s\n", |
459 | (intmax_t)offset, strerror(errno)); |
460 | return TEST_FAILED; |
461 | } |
462 | |
463 | - if (write(fd, buffer, len) != len) { |
464 | + rc = write(fd, buffer, len); |
465 | + if (rc < 0) { |
466 | fprintf(stderr, "Failed to write %zu bytes, position %jd: %s\n", |
467 | len, (intmax_t)offset, strerror(errno)); |
468 | return TEST_FAILED; |
469 | + } else if (((size_t)rc) < len) { |
470 | + fprintf(stderr, "Failed to write %zu bytes, position %jd: short write of %zd bytes\n", |
471 | + len, (intmax_t)offset, rc); |
472 | + return TEST_FAILED; |
473 | } |
474 | return TEST_PASSED; |
475 | } |
476 | |
477 | int test_read(int fd, char *buffer, size_t len, off_t offset) |
478 | { |
479 | + ssize_t rc; |
480 | + |
481 | if (lseek(fd, offset, SEEK_SET) < 0) { |
482 | fprintf(stderr, "Failed to seek to position %jd: %s\n", |
483 | (intmax_t)offset, strerror(errno)); |
484 | return TEST_FAILED; |
485 | } |
486 | |
487 | - if (read(fd, buffer, len) != len) { |
488 | + rc = read(fd, buffer, len); |
489 | + if (rc < 0) { |
490 | fprintf(stderr, "Failed to read %zu bytes, position %jd: %s\n", |
491 | len, (intmax_t)offset, strerror(errno)); |
492 | return TEST_FAILED; |
493 | + } else if (((size_t)rc) < len) { |
494 | + fprintf(stderr, "Failed to read %zu bytes, position %jd: short read of %zd bytes\n", |
495 | + len, (intmax_t)offset, rc); |
496 | + return TEST_FAILED; |
497 | } |
498 | return TEST_PASSED; |
499 | } |
500 | |
501 | === modified file 'tests/kernel/file-concurrent/test.c' |
502 | --- tests/kernel/file-concurrent/test.c 2012-03-08 17:31:44 +0000 |
503 | +++ tests/kernel/file-concurrent/test.c 2013-10-28 17:50:31 +0000 |
504 | @@ -177,7 +177,7 @@ |
505 | |
506 | int test_files(const char *path, const int max_files) |
507 | { |
508 | - int i, j; |
509 | + int i; |
510 | char *filename; |
511 | size_t len = strlen(path) + 32; |
512 | int ret = TEST_PASSED; |
513 | |
514 | === modified file 'tests/kernel/inode-race-stat/test.c' |
515 | --- tests/kernel/inode-race-stat/test.c 2013-03-13 14:55:11 +0000 |
516 | +++ tests/kernel/inode-race-stat/test.c 2013-10-28 17:50:31 +0000 |
517 | @@ -107,7 +107,6 @@ |
518 | { |
519 | for (;;) { |
520 | int n; |
521 | - int ret; |
522 | char cmd[32]; |
523 | |
524 | if ((n = read(fdin, cmd, sizeof(cmd))) < 1) { |
525 | @@ -362,9 +361,9 @@ |
526 | cmd[0] = CMD_QUIT; |
527 | for (i = 0; i < threads; i++) { |
528 | int status; |
529 | - int ret; |
530 | |
531 | - ret = write(pipe_to[i][1], cmd, 1); |
532 | + if (write(pipe_to[i][1], cmd, 1) != 1) |
533 | + continue; |
534 | (void)waitpid(pids[i], &status, 0); |
535 | |
536 | (void)close(pipe_to[i][1]); |
537 | |
538 | === modified file 'tests/kernel/inotify/test.c' |
539 | --- tests/kernel/inotify/test.c 2013-06-06 07:58:30 +0000 |
540 | +++ tests/kernel/inotify/test.c 2013-10-28 17:50:31 +0000 |
541 | @@ -195,7 +195,7 @@ |
542 | * mk_filename() |
543 | * simple helper to create a filename |
544 | */ |
545 | -void inline mk_filename(char *filename, size_t len, const char *path, const char *name) |
546 | +inline void mk_filename(char *filename, size_t len, const char *path, const char *name) |
547 | { |
548 | snprintf(filename, len, "%s/%s", path, name); |
549 | } |
550 | |
551 | === modified file 'tests/kernel/lp-509180/test.c' |
552 | --- tests/kernel/lp-509180/test.c 2012-03-01 15:55:22 +0000 |
553 | +++ tests/kernel/lp-509180/test.c 2013-10-28 17:50:31 +0000 |
554 | @@ -48,7 +48,6 @@ |
555 | int fd; |
556 | int opt, flags = 0; |
557 | int rc = 0; |
558 | - unsigned int *ptr; |
559 | char *file; |
560 | unsigned char buffer[1]; |
561 | |
562 | |
563 | === modified file 'tests/kernel/trunc-file/test.c' |
564 | --- tests/kernel/trunc-file/test.c 2013-07-05 14:56:30 +0000 |
565 | +++ tests/kernel/trunc-file/test.c 2013-10-28 17:50:31 +0000 |
566 | @@ -39,7 +39,7 @@ |
567 | |
568 | int write_buff(int fd, unsigned char *data, ssize_t size) |
569 | { |
570 | - char *ptr = data; |
571 | + unsigned char *ptr = data; |
572 | ssize_t n; |
573 | ssize_t sz = size; |
574 | |
575 | @@ -55,7 +55,7 @@ |
576 | |
577 | int read_buff(int fd, unsigned char *data, ssize_t size) |
578 | { |
579 | - char *ptr = data; |
580 | + unsigned char *ptr = data; |
581 | ssize_t n; |
582 | ssize_t sz = size; |
583 | |
584 | @@ -159,9 +159,6 @@ |
585 | int test_exercise(char *filename, ssize_t size) |
586 | { |
587 | int fd; |
588 | - ssize_t i; |
589 | - ssize_t n; |
590 | - ssize_t buflen; |
591 | int ret = TEST_FAILED; |
592 | ssize_t trunc_size = size / 2; |
593 | struct stat statbuf; |
594 | @@ -257,8 +254,6 @@ |
595 | { |
596 | ssize_t len = DEFAULT_SIZE; |
597 | const ssize_t max_len = SSIZE_MAX / 1024; |
598 | - int i; |
599 | - int ret; |
600 | |
601 | if (argc < 2) { |
602 | fprintf(stderr, "Syntax: %s filename [size_in_K]\n", argv[0]); |
603 | |
604 | === modified file 'tests/userspace/wrap-unwrap/test.c' |
605 | --- tests/userspace/wrap-unwrap/test.c 2013-06-05 18:29:54 +0000 |
606 | +++ tests/userspace/wrap-unwrap/test.c 2013-10-28 17:50:31 +0000 |
607 | @@ -19,7 +19,7 @@ |
608 | int decrypted_passphrase_size; |
609 | char salt[ECRYPTFS_SALT_SIZE + 1]; |
610 | char *path; |
611 | - int i, j; |
612 | + int i; |
613 | int rc = 0; |
614 | |
615 | if (argc != 2) { |
Note that the "Unmerged revisions" section below isn't showing all of the revisions. It is missing the descriptions for r800 through r804. I'm sure you can look at the proposed branch, but here's a quick paste of those revision descriptions:
------- ------- ------- ------- ------- ------- ------- ------- ---- ------- ------- ------- ------- ------- ------- ------- ---- ------- ------- ------- ------- ------- ------- ------- ---- ------- ------- ------- ------- ------- ------- ------- ---- ------- ------- ------- ------- ------- ------- ------- ---- ------- ------- ------- ------- ------- ------- ------- ----
revno: 804
Fix some of the signed and unsigned int comparisons (-Wsign-compare)
-------
revno: 803
Fix -Wempty-body warning
-------
revno: 802
Remove the unused 'order' member of the supported_key_bytes struct
-------
revno: 801
Fix sign comparison warnings and other issues surrounding the uint32_t type
used for key_bytes
-------
revno: 800
Fix 'unused variable' warnings
-------