From 96be2d36022f64364f60d46be27800fe86fdcd9a Mon Sep 17 00:00:00 2001 From: zrj Date: Wed, 24 Jan 2018 09:42:17 +0200 Subject: [PATCH] cvs(1): Avoid -Wstringop-overflow warning. The cvs will terminate after calling it's error(1, ...) but it can not be marked as noreturn. So just add a hint for compiler that memcmp() with read1 == -1 as an argument is not reachable. --- contrib/cvs-1.12/src/filesubr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/contrib/cvs-1.12/src/filesubr.c b/contrib/cvs-1.12/src/filesubr.c index 64e9f4be7a..3837eb9e3d 100644 --- a/contrib/cvs-1.12/src/filesubr.c +++ b/contrib/cvs-1.12/src/filesubr.c @@ -637,8 +637,10 @@ xcmp (const char *file1, const char *file2) do { read1 = block_read (fd1, buf1, buf_size); - if (read1 == (size_t)-1) + if (read1 == (size_t)-1) { error (1, errno, "cannot read file %s for comparing", file1); + exit(1); /* to suppress -Wstringop-overflow */ + } read2 = block_read (fd2, buf2, buf_size); if (read2 == (size_t)-1) -- 2.41.0