From 9d5b333fb6e548aa2a9cda9094ad7e96e3eb33f7 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 20 Nov 2023 17:21:48 +0100 Subject: src|tests: Address warning -Wstrict-prototypes Symptom with Clang 15: > In file included from userinfo.c:20: > ./userinfo.h:38:27: error: a function declaration without a prototype is deprecated in all versions of C [-Werror,-Wstrict-prototypes] > void invalidate_user_cache(); /* safe to call from signal handler */ > ^ > void > [many more] --- tests/odirect_write.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/odirect_write.c') diff --git a/tests/odirect_write.c b/tests/odirect_write.c index bc9040f..626ff5c 100644 --- a/tests/odirect_write.c +++ b/tests/odirect_write.c @@ -70,7 +70,7 @@ int main(int argc, char** argv) { #include -int main() { +int main(void) { fprintf(stderr, "Not supported on this platform.\n"); return 1; } -- cgit v1.2.3 From 2ec3bd610e7308b20eebe2618ee6e695988b4ffe Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 20 Nov 2023 17:35:49 +0100 Subject: odirect_write.c: Resolve unused variable "total_size" Symptom with Clang 17: > tests/odirect_write.c:35:12: warning: variable 'total_size' set but not used [-Wunused-but-set-variable] > 35 | size_t total_size = 0; > | ^ --- tests/odirect_write.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'tests/odirect_write.c') diff --git a/tests/odirect_write.c b/tests/odirect_write.c index 626ff5c..11dde43 100644 --- a/tests/odirect_write.c +++ b/tests/odirect_write.c @@ -32,7 +32,6 @@ int main(int argc, char** argv) { return 1; } - size_t total_size = 0; while (1) { if (feof(stdin)) { break; @@ -48,8 +47,6 @@ int main(int argc, char** argv) { continue; } - total_size += amt_read; - ssize_t res = write(fd, buf, buf_size); if (res == -1) { perror("failed to write"); -- cgit v1.2.3