]> git.ipfire.org Git - thirdparty/coreutils.git/commit
maint: fix -Werror=suggest-attribute=malloc in expr.c
authorCarlos Santos <casantos@datacom.com.br>
Mon, 25 Jun 2018 03:00:14 +0000 (00:00 -0300)
committerPádraig Brady <P@draigBrady.com>
Mon, 25 Jun 2018 04:23:05 +0000 (21:23 -0700)
commit2ed7c2867974ccf7abc61c34ad7bf9565489c18e
tree8ae36bc5effc243958c7f1bc9570ce6fecefc05f
parent932ec637a6d19bc923259b809754ee5a3b3ddc10
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.
src/expr.c