aboutsummaryrefslogtreecommitdiffstats
path: root/src/paste.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2023-05-18 10:38:11 +0100
committerPádraig Brady <P@draigBrady.com>2023-05-18 12:13:47 +0100
commit800c86d5fa6ed32026e33d9db56739b0c696c40e (patch)
tree588d1729df9adcdda3fbb5a701fef66ce75c3ae8 /src/paste.c
parentbuild: gnulib: avoid false -Wstringop-overflow warning (diff)
downloadcoreutils-800c86d5fa6ed32026e33d9db56739b0c696c40e.tar.gz
coreutils-800c86d5fa6ed32026e33d9db56739b0c696c40e.zip
build: avoid false -Wmaybe-uninitialized warnings
Allow easily building a debug build for example with: make CFLAGS='-O0 -ggdb' False -Wmaybe-uninitialized warnings hit in different places depending on the compiler passes used. These changes were tested with gcc 10.2.1, 12.2.1, and 13.1.1 like: for o in g s z fast 0 1 2 3; do make clean && make -j$(nproc) CFLAGS="-O$o" || break done * src/digest.c: Disable -Wmaybe-uninitialized that gives false positive here at -O0. * src/ln.c: Avoid -Wmaybe-uninitialized that gives false positive here at -O1. * src/pr.c: Likewise. * src/sort.c: Likewise. * src/tee.c: Avoid -Wmaybe-uninitialized that gives false positive here at -O3 on gcc 13.1.1 at least. * src/cp.c: Avoid -Wmaybe-uninitialized that gives false positive here at -Os on gcc 13.1.1 at least. * src/copy.c: Avoid -Wmaybe-uninitialized that gives false positive here at -Og on gcc 13.1.1 at least. * src/head.c: Likewise. * src/paste.c: Likewise.
Diffstat (limited to 'src/paste.c')
-rw-r--r--src/paste.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/paste.c b/src/paste.c
index 5c194d8fe..468ef3ab0 100644
--- a/src/paste.c
+++ b/src/paste.c
@@ -233,7 +233,7 @@ paste_parallel (size_t nfiles, char **fnamptr)
for (size_t i = 0; i < nfiles && files_open; i++)
{
- int chr; /* Input character. */
+ int chr IF_LINT ( = -1); /* Input character. */
int err; /* Input errno value. */
bool sometodo = false; /* Input chars to process. */