bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

string: Fix compilation errors in C++ mode on Android


From: Bruno Haible
Subject: string: Fix compilation errors in C++ mode on Android
Date: Thu, 05 Jan 2023 17:36:57 +0100

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]