aboutsummaryrefslogtreecommitdiffstats
path: root/src/expr.c
diff options
context:
space:
mode:
authorCarlos Santos <casantos@datacom.com.br>2018-06-25 00:00:14 -0300
committerPádraig Brady <P@draigBrady.com>2018-06-24 21:23:05 -0700
commit2ed7c2867974ccf7abc61c34ad7bf9565489c18e (patch)
tree8ae36bc5effc243958c7f1bc9570ce6fecefc05f /src/expr.c
parentmaint: update gnulib to latest (diff)
downloadcoreutils-2ed7c2867974ccf7abc61c34ad7bf9565489c18e.tar.gz
coreutils-2ed7c2867974ccf7abc61c34ad7bf9565489c18e.zip
maint: fix -Werror=suggest-attribute=malloc in expr.c
Add attribute 'malloc' to mpz_get_str to prevent the following on GCC 8.1.1 src/expr.c:117:1: error: function might be candidate for attribute 'malloc' if it is known to return normally [-Werror=suggest-attribute=malloc] mpz_get_str (char const *str, int base, mpz_t z) ^~~~~~~~~~~ cc1: all warnings being treated as errors * src/expr.c (mpz_get_str): Add _GL_ATTRIBUTE_MALLOC.
Diffstat (limited to 'src/expr.c')
-rw-r--r--src/expr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/expr.c b/src/expr.c
index f4dbf1792..94eb9e78f 100644
--- a/src/expr.c
+++ b/src/expr.c
@@ -113,7 +113,7 @@ mpz_tdiv_r (mpz_t r, mpz_t a0, mpz_t b0)
/* Some x86-style hosts raise an exception for INT_MIN % -1. */
r[0] = a < - INTMAX_MAX && b == -1 ? 0 : a % b;
}
-static char *
+static char * _GL_ATTRIBUTE_MALLOC
mpz_get_str (char const *str, int base, mpz_t z)
{
(void) str; (void) base;