From 4c0e23155dbd417bc6ede1d03107e8870aca60fc Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Tue, 4 Sep 2012 16:53:19 -0600 Subject: 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 --- m4/builtin.c | 4 ++-- m4/system_.h | 1 + 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__)) -- cgit v1.2.1