From 49281a6d1a1ed1b1711261468ec3db2c5df0b833 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Tue, 14 Nov 2023 00:19:34 +0100 Subject: odirect_write.c: Address warning -Wsign-compare MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Symptom was: > tests/odirect_write.c: In function ‘main’: > tests/odirect_write.c:58:17: error: comparison of integer expressions of different signedness: ‘ssize_t’ {aka ‘long int’} and ‘size_t’ {aka ‘long unsigned int’} [-Werror=sign-compare] > 58 | if (res != buf_size) { > | ^~ --- 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 10b63f9..bc9040f 100644 --- a/tests/odirect_write.c +++ b/tests/odirect_write.c @@ -55,7 +55,7 @@ int main(int argc, char** argv) { perror("failed to write"); return 1; } - if (res != buf_size) { + if ((size_t)res != buf_size) { // Too lazy to write a loop here unless it turns out to be necessary. fprintf(stderr, "Failed to write exactly %lu bytes", (unsigned long)amt_read); } -- cgit v1.2.3