From: Pádraig Brady
Date: Tue, 21 Feb 2023 16:14:44 +0000 (+0000) Subject: maint: avoid -Wmaybe-uninitialized warning from GCC13 X-Git-Tag: v9.2~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afae7787f2fd5b95dabe4d908ad3b8f363d35bf1;p=thirdparty%2Fcoreutils.git 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. --- 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))