summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2011-11-28 22:50:34 +0100
committerJim Meyering <meyering@redhat.com>2011-11-28 22:51:14 +0100
commitbbd6d2ec9eb72193b7720dfb568cec751df13509 (patch)
tree99db3edd795e2e29a1828ef85d977b76011590cf
parenta1482fbe39b58e26b8a05d9c5ed22969fbcf2f47 (diff)
downloadgrep-bbd6d2ec9eb72193b7720dfb568cec751df13509.tar.gz
build: accommodate -Werror=suggest-attribute=pure
Now that we're using the latest manywarnings module from gnulib, accommodate gcc's -Werror=suggest-attribute=pure option by marking suggested functions with gnulib-defined _GL_ATTRIBUTE_PURE. * src/kwset.c (hasevery): Mark function with pure attribute. (bmexec): Likewise. * src/dfa.c (nsubtoks, istrstr, find_pred, dfamusts): Likewise. * configure.ac: Disable (for lib/) options that seem not to be worth the trouble: -Wunsuffixed-float-constants and -Wformat-nonliteral.
-rw-r--r--configure.ac2
-rw-r--r--src/dfa.c8
-rw-r--r--src/kwset.c4
3 files changed, 8 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 0478d520..6c0f29d4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -164,6 +164,8 @@ if test "$gl_gcc_warnings" = yes; then
#nw="$nw -Wmissing-prototypes"
nw="$nw -Wold-style-definition"
nw="$nw -Wcast-align"
+ nw="$nw -Wunsuffixed-float-constants"
+ gl_WARN_ADD([-Wno-format-nonliteral])
gl_MANYWARN_COMPLEMENT([GNULIB_WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
AC_SUBST([GNULIB_WARN_CFLAGS])
fi
diff --git a/src/dfa.c b/src/dfa.c
index 9e7c1368..3214f296 100644
--- a/src/dfa.c
+++ b/src/dfa.c
@@ -755,7 +755,7 @@ static const struct dfa_ctype prednames[] = {
{ NULL, NULL, false }
};
-static const struct dfa_ctype *
+static const struct dfa_ctype * _GL_ATTRIBUTE_PURE
find_pred (const char *str)
{
unsigned int i;
@@ -1679,7 +1679,7 @@ atom (void)
}
/* Return the number of tokens in the given subexpression. */
-static int
+static int _GL_ATTRIBUTE_PURE
nsubtoks (int tindex)
{
int ntoks1;
@@ -3605,7 +3605,7 @@ icpyalloc (char const *string)
return icatalloc (NULL, string);
}
-static char *
+static char * _GL_ATTRIBUTE_PURE
istrstr (char const *lookin, char const *lookfor)
{
char const *cp;
@@ -4017,7 +4017,7 @@ dfaalloc (void)
return xmalloc (sizeof (struct dfa));
}
-struct dfamust *
+struct dfamust * _GL_ATTRIBUTE_PURE
dfamusts (struct dfa const *d)
{
return d->musts;
diff --git a/src/kwset.c b/src/kwset.c
index ba556bbc..124096c7 100644
--- a/src/kwset.c
+++ b/src/kwset.c
@@ -350,7 +350,7 @@ treedelta (struct tree const *tree,
}
/* Return true if A has every label in B. */
-static int
+static int _GL_ATTRIBUTE_PURE
hasevery (struct tree const *a, struct tree const *b)
{
if (!b)
@@ -497,7 +497,7 @@ kwsprep (kwset_t kws)
}
/* Fast boyer-moore search. */
-static size_t
+static size_t _GL_ATTRIBUTE_PURE
bmexec (kwset_t kws, char const *text, size_t size)
{
struct kwset const *kwset;