From: Jim Meyering Date: Sat, 28 Oct 2017 04:14:37 +0000 (-0700) Subject: build: ls.c: apply _GL_ATTRIBUTE_PURE to more functions X-Git-Tag: v8.29~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f89c20bdf7ccc033cbc22662e932fae7761754fc;p=thirdparty%2Fcoreutils.git 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. --- 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