mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
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.
This commit is contained in:
1 parent
932ec637a6
commit
2ed7c28679
1 file changed
+1
-1
+1
-1
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user