]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: avoid new sort.c warning from upcoming GCC11
authorJim Meyering <meyering@fb.com>
Sun, 25 Oct 2020 17:04:19 +0000 (10:04 -0700)
committerJim Meyering <meyering@fb.com>
Mon, 26 Oct 2020 14:47:36 +0000 (07:47 -0700)
gcc version 11.0.0 20201025 (experimental) warns that
src/sort.c:1655:1: warning: function might be candidate for attribute \
  'pure' if it is known to return normally [-Wsuggest-attribute=pure]
* src/sort.c (limfield): Mark as pure.

src/sort.c

index 0163ba18ada4637fe6cd4d2386e33f8cce427182..8671ea767369c79df58d1bc5d3b4713a86e4750b 100644 (file)
@@ -1651,7 +1651,7 @@ begfield (struct line const *line, struct keyfield const *key)
 /* Return the limit of (a pointer to the first character after) the field
    in LINE specified by KEY. */
 
-static char *
+static char * _GL_ATTRIBUTE_PURE
 limfield (struct line const *line, struct keyfield const *key)
 {
   char *ptr = line->text, *lim = ptr + line->length - 1;