From 17aaba6a41608a3f07e04f3e337a3195035c31a3 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 1 Jul 2023 11:31:40 -0700 Subject: [PATCH] maint: pacify GCC bug#109613 better MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * src/cut.c (cut_file): * src/nl.c (nl_file): Pacify GCC Bug#109613 in a better way, by narrowing the coverage of the ‘assume’ so that bugs in the no-longer-covered part are not masked. --- src/cut.c | 3 +-- src/nl.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/cut.c b/src/cut.c index 48ac012805..12dfd2299f 100644 --- a/src/cut.c +++ b/src/cut.c @@ -421,6 +421,7 @@ cut_file (char const *file, void (*cut_stream) (FILE *)) { have_read_stdin = true; stream = stdin; + assume (stream); /* Pacify GCC bug#109613. */ } else { @@ -432,8 +433,6 @@ cut_file (char const *file, void (*cut_stream) (FILE *)) } } - assume (stream); - fadvise (stream, FADVISE_SEQUENTIAL); cut_stream (stream); diff --git a/src/nl.c b/src/nl.c index 3c5a90b564..7b9b369807 100644 --- a/src/nl.c +++ b/src/nl.c @@ -440,6 +440,7 @@ nl_file (char const *file) { have_read_stdin = true; stream = stdin; + assume (stream); /* Pacify GCC bug#109613. */ } else { @@ -451,8 +452,6 @@ nl_file (char const *file) } } - assume (stream); - fadvise (stream, FADVISE_SEQUENTIAL); process_file (stream); -- 2.47.2