]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: pacify GCC bug#109613 better
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 1 Jul 2023 18:31:40 +0000 (11:31 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 1 Jul 2023 18:51:16 +0000 (11:51 -0700)
* 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
src/nl.c

index 48ac0128057a1f54bbc2cd646cdaa4e441aaea4e..12dfd2299f847ef23e21fdfff9a83b410eb1f51c 100644 (file)
--- 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);
index 3c5a90b564123ff95abf8035ee198f19039f0c78..7b9b369807bb5fe0de06878d66961624dd2167f5 100644 (file)
--- 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);