From e397d3f1d3918f62452b25ca26c81f8c39dbd068 Mon Sep 17 00:00:00 2001 From: =?utf8?q?P=C3=A1draig=20Brady?= Date: Sun, 4 Aug 2024 11:45:34 +0100 Subject: [PATCH] maint: avoid warning on older GCC compilers * src/shuf.c: Avoid -Werror=maybe-uninitialized on GCC 10.2.1 at least. This issue does seem to be addressed on GCC 12. --- src/shuf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/shuf.c b/src/shuf.c index 3bc8b3ced2..63c26f31ee 100644 --- a/src/shuf.c +++ b/src/shuf.c @@ -509,7 +509,10 @@ main (int argc, char **argv) line = operand; } else if (input_range) - line = nullptr; + { + IF_LINT (n_lines = hi_input - lo_input + 1); /* Avoid GCC 10 warning. */ + line = nullptr; + } else { /* If an input file is specified, re-open it as stdin. */ -- 2.47.2