]> sourceware.org Git - glibc.git/commitdiff
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)
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

index 1aab34b5866868252c7b672ab3fbbb2e2ff2a583..41ef9c2dd6b552876bda0e6d72c871b965ce137f 100644 (file)
 # 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
This page took 0.04205 seconds and 5 git commands to generate.