coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] build: pacify GCC 13 with -flto


From: Pádraig Brady
Subject: [PATCH] build: pacify GCC 13 with -flto
Date: Fri, 19 May 2023 11:34:48 +0100

* src/cut.c (cut_file): Explicitly mark STREAM as nonnull to avoid
-Werror=null-dereference.
* src/nl.c (nl_file): Likewise.
---
 src/cut.c | 2 ++
 src/nl.c  | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/src/cut.c b/src/cut.c
index e8346b7c7..0b30e6b07 100644
--- a/src/cut.c
+++ b/src/cut.c
@@ -433,6 +433,8 @@ 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 11c140114..ad5c36313 100644
--- a/src/nl.c
+++ b/src/nl.c
@@ -453,6 +453,8 @@ nl_file (char const *file)
         }
     }
 
+  assume (stream);
+
   fadvise (stream, FADVISE_SEQUENTIAL);
 
   process_file (stream);
-- 
2.40.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]