glibc/sysdeps/mach
Joseph Myers af16a59ee1 Fix Hurd getcwd build with GCC >= 13
The build of glibc for i686-gnu has been failing for a while with GCC
mainline / GCC 13:

../sysdeps/mach/hurd/getcwd.c: In function '__hurd_canonicalize_directory_name_internal':
../sysdeps/mach/hurd/getcwd.c:242:48: error: pointer 'file_name' may be used after 'realloc' [-Werror=use-after-free]
  242 |                   file_namep = &buf[file_namep - file_name + size / 2];
      |                                     ~~~~~~~~~~~^~~~~~~~~~~
../sysdeps/mach/hurd/getcwd.c:236:25: note: call to 'realloc' here
  236 |                   buf = realloc (file_name, size);
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~

Fix by doing the subtraction before the reallocation.

Tested with build-many-glibcs.py for i686-gnu.

[samuel.thibault@ens-lyon.rg: Removed mention of this being a bug]

Message-Id: <18587337-7815-4056-ebd0-724df262d591@codesourcery.com>
2023-04-27 01:27:28 +02:00
..
htl
hurd Fix Hurd getcwd build with GCC >= 13 2023-04-27 01:27:28 +02:00
i386 Define PC, SP and SYSRETURN for hurd x86_64 2023-02-20 01:33:15 +01:00
include
sys
x86 Define PC, SP and SYSRETURN for hurd x86_64 2023-02-20 01:33:15 +01:00
x86_64 hurd: Set up the basic tree for x86_64-gnu 2023-02-12 16:12:06 +01:00
Makefile
Subdirs
_strerror.c
adjtime.c
clock_gettime.c
clock_nanosleep.c
configure hurd: Stop depending on the default_pager stubs provided by gnumach 2023-04-10 19:01:52 +02:00
configure.ac hurd: Stop depending on the default_pager stubs provided by gnumach 2023-04-10 19:01:52 +02:00
getloadavg.c
getpagesize.c
getsysstats.c
libc-lock.h mach, hurd: Drop __libc_lock_self0 2023-04-03 01:02:44 +02:00
libmachuser.abilist
mprotect.c
msync.c
munmap.c
pagecopy.h
readonly-area.c
sched_yield.c
sleep.c
strerror_l.c
sysdep.h hurd: Remove __hurd_local_reply_port 2023-04-14 10:31:22 +00:00
thread_state.h
usleep.c
xpg-strerror.c