* lib/readutmp.c (have_boot_time): Mark the function with _GL_ATTRIBUTE_PURE.

GCC 14.2.0 complains about it missing when compiling GNU coreutils.
---
 ChangeLog      | 5 +++++
 lib/readutmp.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 2b35fe2905..8d755ebea0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-09-15  Samuel Tardieu  <s...@rfc1149.net>
+
+       * lib/readutmp.c (have_boot_time): Mark the function with
+       _GL_ATTRIBUTE_PURE.
+
 2024-09-14  Bruno Haible  <br...@clisp.org>
 
        unilbrk/tables: Fix table (regression yesterday).
diff --git a/lib/readutmp.c b/lib/readutmp.c
index 0938a094cb..fd84a1e4de 100644
--- a/lib/readutmp.c
+++ b/lib/readutmp.c
@@ -301,7 +301,7 @@ finish_utmp (struct utmp_alloc a)
 
 /* Determine whether A already contains an entry of type BOOT_TIME.  */
 _GL_ATTRIBUTE_MAYBE_UNUSED
-static bool
+static bool _GL_ATTRIBUTE_PURE
 have_boot_time (struct utmp_alloc a)
 {
   for (idx_t i = 0; i < a.filled; i++)
-- 
2.46.0


Reply via email to