bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* string: Fix compilation errors in C++ mode on Android
@ 2023-01-05 16:36 Bruno Haible
  0 siblings, 0 replies; only message in thread
From: Bruno Haible @ 2023-01-05 16:36 UTC (permalink / raw)
  To: bug-gnulib

On Android, I'm seeing these compilation errors:


../gllib/string.h:855:1: error: reference to overloaded function could not be resolved; did you mean to call it?
_GL_CXXALIASWARN (memrchr);
^~~~~~~~~~~~~~~~~~~~~~~~~~

../gllib/string.h:1010:1: error: reference to overloaded function could not be resolved; did you mean to call it?
_GL_CXXALIASWARN (strchrnul);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~

../gllib/string.h:1375:1: error: reference to overloaded function could not be resolved; did you mean to call it?
_GL_CXXALIASWARN (strcasestr);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~


This patch fixes them.


2023-01-05  Bruno Haible  <bruno@clisp.org>

	string: Fix compilation errors in C++ mode on Android.
	* lib/string.in.h (memrchr, strchrnul, strcasestr): Disable
	_GL_CXXALIASWARN invocation on non-glibc systems.

diff --git a/lib/string.in.h b/lib/string.in.h
index b2683b6e4c..b227a17887 100644
--- a/lib/string.in.h
+++ b/lib/string.in.h
@@ -344,7 +344,7 @@ _GL_CXXALIAS_SYS_CAST2 (memrchr,
          || defined __clang__)
 _GL_CXXALIASWARN1 (memrchr, void *, (void *, int, size_t) throw ());
 _GL_CXXALIASWARN1 (memrchr, void const *, (void const *, int, size_t) throw ());
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (memrchr);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -499,7 +499,7 @@ _GL_CXXALIAS_SYS_CAST2 (strchrnul,
 _GL_CXXALIASWARN1 (strchrnul, char *, (char *__s, int __c_in) throw ());
 _GL_CXXALIASWARN1 (strchrnul, char const *,
                    (char const *__s, int __c_in) throw ());
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (strchrnul);
 # endif
 #elif defined GNULIB_POSIXCHECK
@@ -864,7 +864,7 @@ _GL_CXXALIASWARN1 (strcasestr, char *,
                    (char *haystack, const char *needle) throw ());
 _GL_CXXALIASWARN1 (strcasestr, const char *,
                    (const char *haystack, const char *needle) throw ());
-# else
+# elif __GLIBC__ >= 2
 _GL_CXXALIASWARN (strcasestr);
 # endif
 #elif defined GNULIB_POSIXCHECK





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-05 17:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-05 16:36 string: Fix compilation errors in C++ mode on Android Bruno Haible

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).