From: H.J. Lu Date: Tue, 17 Dec 2024 22:55:35 +0000 (+0800) Subject: Replace __strcpy_chk with __builtin___strcpy_chk X-Git-Tag: glibc-2.41~326 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd90d3ca7d5b515cb096d8c1d7c83b94ef6eba71;p=thirdparty%2Fglibc.git Replace __strcpy_chk with __builtin___strcpy_chk Although _chk functions are exported in libc.so.6, their prototypes aren't provided. Their built versions are supported by compiler. Replace __strcpy_chk with __builtin___strcpy_chk to silence Clang error: ./tst-gnuglob-skeleton.c:225:3: error: call to undeclared function '__strcpy_chk'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] 225 | __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX); | ^ Signed-off-by: H.J. Lu Reviewed-by: Siddhesh Poyarekar --- diff --git a/posix/tst-glob_lstat_compat.c b/posix/tst-glob_lstat_compat.c index 6ea3b062f0..752a8c8707 100644 --- a/posix/tst-glob_lstat_compat.c +++ b/posix/tst-glob_lstat_compat.c @@ -173,7 +173,8 @@ my_readdir (void *gdir) dir->d.d_type = filesystem[dir->idx].type; - __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX); + __builtin___strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, + NAME_MAX); ++dir->idx; diff --git a/posix/tst-gnuglob-skeleton.c b/posix/tst-gnuglob-skeleton.c index 145744199b..31e0c136b8 100644 --- a/posix/tst-gnuglob-skeleton.c +++ b/posix/tst-gnuglob-skeleton.c @@ -222,7 +222,8 @@ my_readdir (void *gdir) dir->d.d_type = filesystem[dir->idx].type; - __strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, NAME_MAX); + __builtin___strcpy_chk (dir->d.d_name, filesystem[dir->idx].name, + NAME_MAX); if (test_verbose > 0) printf ("info: my_readdir ({ level: %d, idx: %ld })"