]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
build: ls.c: apply _GL_ATTRIBUTE_PURE to more functions
authorJim Meyering <meyering@fb.com>
Sat, 28 Oct 2017 04:14:37 +0000 (21:14 -0700)
committerJim Meyering <meyering@fb.com>
Sat, 28 Oct 2017 04:18:46 +0000 (21:18 -0700)
* 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

index 49e345aecaf3bb5042468c8b8b6d9e41d52c7216..073e135e4db6bd1c8b1aa23b6b3aaad1224fe182 100644 (file)
--- 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