In a testdir on Android, I'm seeing this compilation error: clang++ -ferror-limit=0 -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -I. -I../../gltests -I.. -DGNULIB_STRICT_CHECKING=1 -DIN_GNULIB_TESTS=1 -I. -I../../gltests -I.. -I../../gltests/.. -I../gllib -I../../gltests/../gllib -I/data/data/com.termux/files/home/local/include -Wall -Wno-error -g -O2 -c -o test-sys_ioctl-c++.o ../../gltests/test-sys_ioctl-c++.cc In file included from ../../gltests/test-sys_ioctl-c++.cc:22: ../gllib/sys/ioctl.h:546:1: error: reference to overloaded function could not be resolved; did you mean to call it? _GL_CXXALIASWARN (ioctl); ^~~~~~~~~~~~~~~~~~~~~~~~
This patch fixes it. 2023-01-10 Bruno Haible <br...@clisp.org> sys_ioctl: Fix compilation error in C++ mode on Android. * lib/sys_ioctl.in.h (ioctl): Disable _GL_CXXALIASWARN invocation on non-glibc systems. diff --git a/lib/sys_ioctl.in.h b/lib/sys_ioctl.in.h index 26acd19c8d..86840e45a9 100644 --- a/lib/sys_ioctl.in.h +++ b/lib/sys_ioctl.in.h @@ -62,7 +62,9 @@ _GL_FUNCDECL_SYS (ioctl, int, _GL_CXXALIAS_SYS (ioctl, int, (int fd, int request, ... /* {void *,char *} arg */)); # endif +# if __GLIBC__ >= 2 _GL_CXXALIASWARN (ioctl); +# endif #elif @SYS_IOCTL_H_HAVE_WINSOCK2_H_AND_USE_SOCKETS@ # undef ioctl # define ioctl ioctl_used_without_requesting_gnulib_module_ioctl