From afae7787f2fd5b95dabe4d908ad3b8f363d35bf1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Tue, 21 Feb 2023 16:14:44 +0000 Subject: [PATCH] maint: avoid -Wmaybe-uninitialized warning from GCC13 * src/copy.c (infer_scantype): Always set scan_inference.ext_start, as per commit 6c03e8fb which was inadvertently reverted by d374d32c. --- src/copy.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/copy.c b/src/copy.c index 3450e90fc3..3f54bd561f 100644 --- a/src/copy.c +++ b/src/copy.c @@ -1052,11 +1052,13 @@ union scan_inference }; /* Return how to scan a file with descriptor FD and stat buffer SB. - Set *SCAN_INFERENCE if returning LSEEK_SCANTYPE. */ + *SCAN_INFERENCE is set to a valid value if returning LSEEK_SCANTYPE. */ static enum scantype infer_scantype (int fd, struct stat const *sb, union scan_inference *scan_inference) { + scan_inference->ext_start = -1; /* avoid -Wmaybe-uninitialized */ + if (! (HAVE_STRUCT_STAT_ST_BLOCKS && S_ISREG (sb->st_mode) && ST_NBLOCKS (*sb) < sb->st_size / ST_NBLOCKSIZE)) -- 2.47.2