summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <eblake@redhat.com>2012-09-04 16:53:19 -0600
committerGary V. Vaughan <gary@gnu.org>2013-09-18 20:53:32 +0700
commit4c0e23155dbd417bc6ede1d03107e8870aca60fc (patch)
tree4eb924a7c9be5518bbca12fea364a543732bed57
parent2bacbb871b9dd05362405cf2ceedb32a0f6d14e2 (diff)
downloadm4-4c0e23155dbd417bc6ede1d03107e8870aca60fc.tar.gz
build: mark several pure functions
Found by using gcc 4.7.0's -Wsuggest-attribute=pure. * m4/system_.h (M4_GNUC_PURE): New macro. * m4/builtin.c (m4_builtin_find_by_name, m4_builtin_find_by_func): Mark pure. Signed-off-by: Eric Blake <eblake@redhat.com>
-rw-r--r--m4/builtin.c4
-rw-r--r--m4/system_.h1
2 files changed, 3 insertions, 2 deletions
diff --git a/m4/builtin.c b/m4/builtin.c
index c46e5b51..51f636e4 100644
--- a/m4/builtin.c
+++ b/m4/builtin.c
@@ -38,7 +38,7 @@ compare_builtin_name_CB (const void *name, const void *b)
search only in MODULE's builtin table. The result is a malloc'd
symbol value, suitable for use in the symbol table or for an
argument to m4_push_builtin. */
-m4_symbol_value *
+m4_symbol_value * M4_GNUC_PURE
m4_builtin_find_by_name (m4_module *module, const char *name)
{
m4_module *cur = module ? module : m4__module_next (NULL);
@@ -64,7 +64,7 @@ m4_builtin_find_by_name (m4_module *module, const char *name)
then search only in MODULE's builtin table. The result is a
malloc'd symbol value, suitable for use in the symbol table or for
an argument to m4_push_builtin. */
-m4_symbol_value *
+m4_symbol_value * M4_GNUC_PURE
m4_builtin_find_by_func (m4_module *module, m4_builtin_func *func)
{
m4_module *cur = module ? module : m4__module_next (NULL);
diff --git a/m4/system_.h b/m4/system_.h
index d9b4373e..01b8e05a 100644
--- a/m4/system_.h
+++ b/m4/system_.h
@@ -144,6 +144,7 @@ BEGIN_C_DECLS
#define M4_GNUC_NORETURN M4_GNUC_ATTRIBUTE ((__noreturn__))
#define M4_GNUC_CONST M4_GNUC_ATTRIBUTE ((__const__))
#define M4_GNUC_UNUSED M4_GNUC_ATTRIBUTE ((__unused__))
+#define M4_GNUC_PURE M4_GNUC_ATTRIBUTE ((__pure__))