FYI, without this patch and with very recent gcc, I would see warnings
like this:

  lib/freading.c:29:1: error: function might be candidate for attribute 'pure'\
     [-Werror=suggest-attribute=pure]
From b076a606c06a7bf7150c9591028052884d48232f Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyer...@fb.com>
Date: Fri, 22 Nov 2013 08:14:30 -0800
Subject: [PATCH] freading: declare with attribute "pure"

* lib/freading.h (freading): Declare with the "pure" attribute.
---
 ChangeLog      | 3 +++
 lib/freading.h | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 8f50c2d..8ac6053 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-01-02  Jim Meyering  <meyer...@fb.com>

+       freading: declare with the "pure" attribute
+       * lib/freading.h (freading): Declare with the "pure" attribute.
+
        manywarnings: remove -Wmudflap
        * m4/manywarnings.m4 (gl_MANYWARN_ALL_GCC): Remove -Wmudflap, since
        it is no longer supported in gcc-4.9-to-be.
diff --git a/lib/freading.h b/lib/freading.h
index e4aca78..3d1c7b2 100644
--- a/lib/freading.h
+++ b/lib/freading.h
@@ -44,7 +44,7 @@
 extern "C" {
 # endif

-extern bool freading (FILE *stream);
+extern bool freading (FILE *stream) _GL_ATTRIBUTE_PURE;

 # ifdef __cplusplus
 }
-- 
1.8.5.2.229.g4448466

Reply via email to