bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Subject: sys_ioctl: Fix compilation error in C++ mode on Android
Date: Tue, 10 Jan 2023 09:13:46 +0100	[thread overview]
Message-ID: <2468983.sGnKIMrFRI@nimes> (raw)

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  <bruno@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





                 reply	other threads:[~2023-01-10  8:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2468983.sGnKIMrFRI@nimes \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).