bug-patch
[Top][All Lists]
Advanced

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

[bug-patch] [PATCH] build: mark an internal function as "pure"


From: Jim Meyering
Subject: [bug-patch] [PATCH] build: mark an internal function as "pure"
Date: Wed, 01 Aug 2012 14:38:22 +0200

Without this patch and configured with --enable-gcc-warnings,
building with recent gcc would fail:

  pch.c: In function 'sha1_says_nonexistent':
  pch.c:363:1: error: function might be candidate for attribute 'pure'\
    if it is known to return normally [-Werror=suggest-attribute=pure]


>From 4b53f76083b1557b529968159fe88581d89058a4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <address@hidden>
Date: Wed, 1 Aug 2012 14:32:33 +0200
Subject: [PATCH] build: mark an internal function as "pure"

* src/pch.c (sha1_says_nonexistent): Apply _GL_ATTRIBUTE_PURE,
to avoid failure with -Werror=suggest-attribute=pure.
---
 src/pch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/pch.c b/src/pch.c
index c4205f2..05874e0 100644
--- a/src/pch.c
+++ b/src/pch.c
@@ -359,7 +359,7 @@ get_sha1(char **sha1, char const *start, char const *end)
   (*sha1)[len] = 0;
 }

-static int
+static int _GL_ATTRIBUTE_PURE
 sha1_says_nonexistent(char const *sha1)
 {
   char const *empty_sha1 = "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";
--
1.7.12.rc1.10.g97c7934



reply via email to

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