malloc: Fix set-freeres.c with gcc 6
authorAdhemerval Zanella Netto <adhemerval.zanella@linaro.org>
Mon, 24 Jul 2023 17:15:22 +0000 (14:15 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Wed, 26 Jul 2023 12:45:22 +0000 (09:45 -0300)
commit7dfa534ef07cffe9ddb2614e25fbb2e9ae193164
tree3e10256355624e8576037270776c3a83cc992c58
parentb40f5f84c41bc484d4792531a693d7583cecae0a
malloc: Fix set-freeres.c with gcc 6

Old GCC might trigger the the comparison will always evaluate as ‘true’
warnig for static build:

set-freeres.c:87:14: error: the comparison will always evaluate as
‘true’ for the address of ‘__libc_getgrgid_freemem_ptr’ will never be
NULL [-Werror=address]
   if (&__ptr != NULL)      \

So add pragma weak for all affected usages.

Checked on x86_64 and i686 with gcc 6 and 13.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
malloc/set-freeres.c