From f89c20bdf7ccc033cbc22662e932fae7761754fc Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Fri, 27 Oct 2017 21:14:37 -0700 Subject: [PATCH] build: ls.c: apply _GL_ATTRIBUTE_PURE to more functions * src/ls.c (DEFINE_SORT_FUNCTIONS): Apply _GL_ATTRIBUTE_PURE to each strcmp-derived function definition, since GCC8 with -Wsuggest-attribute=pure now warns it is needed. --- src/ls.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ls.c b/src/ls.c index 49e345aeca..073e135e4d 100644 --- a/src/ls.c +++ b/src/ls.c @@ -3603,25 +3603,25 @@ typedef int (*qsortFunc)(V a, V b); /* direct, non-dirfirst versions */ \ static int xstrcoll_##key_name (V a, V b) \ { return key_cmp_func (a, b, xstrcoll); } \ - static int strcmp_##key_name (V a, V b) \ + static int _GL_ATTRIBUTE_PURE strcmp_##key_name (V a, V b) \ { return key_cmp_func (a, b, strcmp); } \ \ /* reverse, non-dirfirst versions */ \ static int rev_xstrcoll_##key_name (V a, V b) \ { return key_cmp_func (b, a, xstrcoll); } \ - static int rev_strcmp_##key_name (V a, V b) \ + static int _GL_ATTRIBUTE_PURE rev_strcmp_##key_name (V a, V b) \ { return key_cmp_func (b, a, strcmp); } \ \ /* direct, dirfirst versions */ \ static int xstrcoll_df_##key_name (V a, V b) \ { DIRFIRST_CHECK (a, b); return key_cmp_func (a, b, xstrcoll); } \ - static int strcmp_df_##key_name (V a, V b) \ + static int _GL_ATTRIBUTE_PURE strcmp_df_##key_name (V a, V b) \ { DIRFIRST_CHECK (a, b); return key_cmp_func (a, b, strcmp); } \ \ /* reverse, dirfirst versions */ \ static int rev_xstrcoll_df_##key_name (V a, V b) \ { DIRFIRST_CHECK (a, b); return key_cmp_func (b, a, xstrcoll); } \ - static int rev_strcmp_df_##key_name (V a, V b) \ + static int _GL_ATTRIBUTE_PURE rev_strcmp_df_##key_name (V a, V b) \ { DIRFIRST_CHECK (a, b); return key_cmp_func (b, a, strcmp); } static inline int -- 2.47.2