From: Carlos Santos Date: Mon, 25 Jun 2018 03:00:14 +0000 (-0300) Subject: maint: fix -Werror=suggest-attribute=malloc in expr.c X-Git-Tag: v8.30~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2ed7c2867974ccf7abc61c34ad7bf9565489c18e;p=thirdparty%2Fcoreutils.git 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. --- diff --git a/src/expr.c b/src/expr.c index f4dbf17927..94eb9e78ff 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;