From cd90d3ca7d5b515cb096d8c1d7c83b94ef6eba71 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 18 Dec 2024 06:55:35 +0800 Subject: 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 --- posix/tst-glob_lstat_compat.c | 3 ++- posix/tst-gnuglob-skeleton.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'posix') 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 })" -- cgit v1.2.3