Building a testdir on Android, I see this warning: ../../gllib/renameatu.c:106:13: warning: call to undeclared function 'renameat2'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
The cause is this API-level conditional declaration: /usr/include/stdio.h:int renameat2(int __old_dir_fd, const char* __old_path, int __new_dir_fd, const char* __new_path, unsigned __flags) __INTRODUCED_IN(30); This patch fixes the warning. 2023-01-10 Bruno Haible <br...@clisp.org> renameat, renameatu: Fix warning on Android. * m4/renameat.m4 (gl_FUNC_RENAMEAT): Test for renameat2 using gl_CHECK_FUNCS_ANDROID instead of AC_CHECK_FUNCS_ONCE. diff --git a/m4/renameat.m4 b/m4/renameat.m4 index 7e38e436a3..3780578663 100644 --- a/m4/renameat.m4 +++ b/m4/renameat.m4 @@ -1,4 +1,4 @@ -# serial 3 +# serial 4 # See if we need to provide renameat replacement. dnl Copyright (C) 2009-2023 Free Software Foundation, Inc. @@ -15,11 +15,12 @@ AC_DEFUN([gl_FUNC_RENAMEAT], AC_REQUIRE([gl_STDIO_H_DEFAULTS]) AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) AC_CHECK_HEADERS([linux/fs.h]) - AC_CHECK_FUNCS_ONCE([renameat renameat2]) + AC_CHECK_FUNCS_ONCE([renameat]) if test $ac_cv_func_renameat = no; then HAVE_RENAMEAT=0 elif test $REPLACE_RENAME = 1; then dnl Solaris 9 and 10 have the same bugs in renameat as in rename. REPLACE_RENAMEAT=1 fi + gl_CHECK_FUNCS_ANDROID([renameat2], [[#include <stdio.h>]]) ])