From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 9B2D61F47C for ; Thu, 5 Jan 2023 17:39:12 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=clisp.org header.i=@clisp.org header.a=rsa-sha256 header.s=strato-dkim-0002 header.b=UW8Si1gr; dkim-atps=neutral Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pDUBK-0000o7-QV; Thu, 05 Jan 2023 12:37:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDUBI-0000ke-SC for bug-gnulib@gnu.org; Thu, 05 Jan 2023 12:37:32 -0500 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.219]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pDUBH-0006IH-04 for bug-gnulib@gnu.org; Thu, 05 Jan 2023 12:37:32 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1672940247; s=strato-dkim-0002; d=clisp.org; h=Message-ID:Date:Subject:To:From:Cc:Date:From:Subject:Sender; bh=5Kpnn9cQ+Hb60WOM6IxRVNNl3Sw6VyxxJ3yW9H0y4rw=; b=UW8Si1griCGMFZde3ID0CdPyZ2TkLxgKkrXYtrFmNogAlnTwk+9j49h9sPYaPTO1JE hH6TnxTflWXxjPZR6RXM7XaU1UQERNX4fKs//zjvDKhW4IM5GI4vAHKiJ/hst1Maucpq 0D0iO7zBQvhUJVzuWQwwQ4rNgjuGE3F5Tn4i4Uvs5r1EzijyUkMsvY7NOH+AXxzsHAVE 7J5SP9/lFMXv9E9LfK1Jh+iRiLEHZsNXPPhWkn1SL82n59CXPMBb/tr2ztd5PEfYkTC3 kgHU5VvQoyeAyQQF0bfCLRirZ/ZXoGjiqzQvP+pWKFSHwEQPTC7a5Re/8hqHE9CWes8U X0ZA== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":Ln4Re0+Ic/6oZXR1YgKryK8brlshOcZlIWs+iCP5vnk6shH0WWb0LN8XZoH94zq68+3cfpOR3fVti/6PSt1RD9k1A7iT+nC0sQ==" X-RZG-CLASS-ID: mo00 Received: from nimes.localnet by smtp.strato.de (RZmta 48.2.1 AUTH) with ESMTPSA id t05890z05HbRBuV (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Thu, 5 Jan 2023 18:37:27 +0100 (CET) From: Bruno Haible To: bug-gnulib@gnu.org Subject: getpass: Fix compilation error on Android Date: Thu, 05 Jan 2023 17:18:41 +0100 Message-ID: <3510174.kGzlxMrEDr@nimes> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=81.169.146.219; envelope-from=bruno@clisp.org; helo=mo4-p00-ob.smtp.rzone.de X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: bug-gnulib@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gnulib discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org Sender: bug-gnulib-bounces+normalperson=yhbt.net@gnu.org On Android, I'm seeing this compilation error: clang -DHAVE_CONFIG_H -DEXEEXT=\"\" -DEXEEXT=\"\" -DNO_XMALLOC -DEXEEXT=\"\" -I. -I../../gllib -I.. -DGNULIB_STRICT_CHECKING=1 -I/data/data/com.termux/files/home/local/include -Wall -fvisibility=hidden -O2 -c -o getpass.o ../../gllib/getpass.c ../../gllib/getpass.c:85:1: error: redefinition of 'getpass' getpass (const char *prompt) ^ /data/data/com.termux/files/usr/include/unistd.h:419:25: note: previous definition is here static __inline__ char* getpass(const char* prompt) { ^ 1 error generated. make[3]: *** [Makefile:10690: getpass.o] Error 1 The cause is that Android's defines getpass() as an inline function. This should better be avoided. 2023-01-05 Bruno Haible getpass: Fix compilation error on Android. * m4/getpass.m4 (gl_FUNC_GETPASS): Define NO_INLINE_GETPASS. * doc/glibc-functions/getpass.texi: Mention the Android problem. diff --git a/doc/glibc-functions/getpass.texi b/doc/glibc-functions/getpass.texi index 17f1b2374b..8d2ff847ee 100644 --- a/doc/glibc-functions/getpass.texi +++ b/doc/glibc-functions/getpass.texi @@ -22,6 +22,10 @@ Portability problems fixed by either Gnulib module @code{getpass} or @code{getpa @item This function is missing on some platforms: mingw, MSVC 14, Android 9.0. +@item +This function cannot be called from plain inline or extern inline functions +on some platforms: +Android 13. @end itemize Portability problems fixed by Gnulib module @code{getpass-gnu}: diff --git a/m4/getpass.m4 b/m4/getpass.m4 index 15882712d9..2dce1e0dfe 100644 --- a/m4/getpass.m4 +++ b/m4/getpass.m4 @@ -1,4 +1,4 @@ -# getpass.m4 serial 17 +# getpass.m4 serial 18 dnl Copyright (C) 2002-2003, 2005-2006, 2009-2023 Free Software Foundation, dnl Inc. dnl This file is free software; the Free Software Foundation @@ -13,6 +13,9 @@ AC_DEFUN_ONCE([gl_FUNC_GETPASS], dnl Persuade Solaris and to declare getpass(). AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) + dnl Persuade Android to not define getpass() as an inline function. + AC_DEFINE([NO_INLINE_GETPASS], [1], [Define to 1 on Android.]) + AC_CHECK_FUNCS_ONCE([getpass]) if test $ac_cv_func_getpass = no; then HAVE_GETPASS=0