From 7dfa534ef07cffe9ddb2614e25fbb2e9ae193164 Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Netto Date: Mon, 24 Jul 2023 14:15:22 -0300 Subject: malloc: Fix set-freeres.c with gcc 6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- malloc/set-freeres.c | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/malloc/set-freeres.c b/malloc/set-freeres.c index 1aab34b..41ef9c2 100644 --- a/malloc/set-freeres.c +++ b/malloc/set-freeres.c @@ -63,6 +63,52 @@ # pragma weak __libpthread_freeres # pragma weak __libc_dlerror_result_free # pragma weak __check_pf_freemem +# pragma weak __libc_fgetgrent_freemem_ptr +# pragma weak __libc_fgetsgent_freeres_ptr +# pragma weak __libc_getnetgrent_freemem_ptr +# pragma weak __libc_rcmd_freemem_ptr +# pragma weak __libc_rexec_freemem_ptr +# pragma weak __libc_mntent_freemem_ptr +# pragma weak __libc_fgetpwent_freemem_ptr +# pragma weak __libc_getspent_freemem_ptr +# pragma weak __libc_resolv_res_hconf_freemem_ptr +# pragma weak __libc_fgetspent_freemem_ptr +# pragma weak __libc_tzfile_freemem_ptr +# pragma weak __libc_getnameinfo_freemem_ptr +# pragma weak __libc_getutent_freemem_ptr +# pragma weak __libc_getutid_freemem_ptr +# pragma weak __libc_getutline_freemem_ptr +# pragma weak __libc_reg_printf_freemem_ptr +# pragma weak __libc_reg_type_freemem_ptr +# pragma weak __libc_getgrgid_freemem_ptr +# pragma weak __libc_getgrnam_freemem_ptr +# pragma weak __libc_getpwnam_freemem_ptr +# pragma weak __libc_getpwuid_freemem_ptr +# pragma weak __libc_getspnam_freemem_ptr +# pragma weak __libc_getaliasbyname_freemem_ptr +# pragma weak __libc_gethostbyaddr_freemem_ptr +# pragma weak __libc_gethostbyname_freemem_ptr +# pragma weak __libc_gethostbyname2_freemem_ptr +# pragma weak __libc_getnetbyaddr_freemem_ptr +# pragma weak __libc_getnetbyname_freemem_ptr +# pragma weak __libc_getprotobynumber_freemem_ptr +# pragma weak __libc_getprotobyname_freemem_ptr +# pragma weak __libc_getrpcbyname_freemem_ptr +# pragma weak __libc_getrpcbynumber_freemem_ptr +# pragma weak __libc_getservbyname_freemem_ptr +# pragma weak __libc_getservbyport_freemem_ptr +# pragma weak __libc_getgrent_freemem_ptr +# pragma weak __libc_getpwent_freemem_ptr +# pragma weak __libc_getaliasent_freemem_ptr +# pragma weak __libc_gethostent_freemem_ptr +# pragma weak __libc_getnetent_freemem_ptr +# pragma weak __libc_getprotoent_freemem_ptr +# pragma weak __libc_getrpcent_freemem_ptr +# pragma weak __libc_getservent_freemem_ptr +# pragma weak __libc_efgcvt_freemem_ptr +# pragma weak __libc_qefgcvt_freemem_ptr +# pragma weak __libc_qefgcvt_freemem_ptr +# pragma weak __ttyname_freemem_ptr #endif #ifdef SHARED -- cgit v1.1