From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-commits+bounces-1607301-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256)
	(No client certificate requested)
	by finch.gentoo.org (Postfix) with ESMTPS id AA749158041
	for <garchives@archives.gentoo.org>; Mon,  4 Mar 2024 17:00:39 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id C128AE2A37;
	Mon,  4 Mar 2024 17:00:38 +0000 (UTC)
Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by pigeon.gentoo.org (Postfix) with ESMTPS id A201BE2A37
	for <gentoo-commits@lists.gentoo.org>; Mon,  4 Mar 2024 17:00:38 +0000 (UTC)
Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52])
	(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)
	 key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256)
	(No client certificate requested)
	by smtp.gentoo.org (Postfix) with ESMTPS id 9FE98343023
	for <gentoo-commits@lists.gentoo.org>; Mon,  4 Mar 2024 17:00:37 +0000 (UTC)
Received: from localhost.localdomain (localhost [IPv6:::1])
	by oystercatcher.gentoo.org (Postfix) with ESMTP id 095D8118C
	for <gentoo-commits@lists.gentoo.org>; Mon,  4 Mar 2024 17:00:36 +0000 (UTC)
From: "Michael Orlitzky" <mjo@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Content-Transfer-Encoding: 8bit
Content-type: text/plain; charset=UTF-8
Reply-To: gentoo-dev@lists.gentoo.org, "Michael Orlitzky" <mjo@gentoo.org>
Message-ID: <1709570947.65a1a144e66496d746998a54d2c5ad7cf53252cb.mjo@gentoo>
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/php/files/, dev-lang/php/
X-VCS-Repository: repo/gentoo
X-VCS-Files: dev-lang/php/files/php-8.1.27-implicit-decls.patch dev-lang/php/php-8.1.27-r1.ebuild dev-lang/php/php-8.1.27-r2.ebuild
X-VCS-Directories: dev-lang/php/files/ dev-lang/php/
X-VCS-Committer: mjo
X-VCS-Committer-Name: Michael Orlitzky
X-VCS-Revision: 65a1a144e66496d746998a54d2c5ad7cf53252cb
X-VCS-Branch: master
Date: Mon,  4 Mar 2024 17:00:36 +0000 (UTC)
Precedence: bulk
List-Post: <mailto:gentoo-commits@lists.gentoo.org>
List-Help: <mailto:gentoo-commits+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-commits+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-commits+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-commits.gentoo.org>
X-BeenThere: gentoo-commits@lists.gentoo.org
X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply
X-Archives-Salt: ae362e68-7bc8-404f-b65d-bd2865d3f9bc
X-Archives-Hash: 8c7335dfb951f4e4c9894bb2a1074546

commit:     65a1a144e66496d746998a54d2c5ad7cf53252cb
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Mon Mar  4 16:42:16 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Mon Mar  4 16:49:07 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=65a1a144

dev-lang/php: some more implicit function decl fixes for 8.1.x

Closes: https://bugs.gentoo.org/925877
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 dev-lang/php/files/php-8.1.27-implicit-decls.patch | 72 ++++++++++++++++++++++
 .../{php-8.1.27-r1.ebuild => php-8.1.27-r2.ebuild} |  7 +++
 2 files changed, 79 insertions(+)

diff --git a/dev-lang/php/files/php-8.1.27-implicit-decls.patch b/dev-lang/php/files/php-8.1.27-implicit-decls.patch
new file mode 100644
index 000000000000..443b02ba17c2
--- /dev/null
+++ b/dev-lang/php/files/php-8.1.27-implicit-decls.patch
@@ -0,0 +1,72 @@
+From 79df2b9dcbe0388667c832b2c702ca3158330ed7 Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Mon, 4 Mar 2024 11:48:01 -0500
+Subject: [PATCH] ext/iconv/config.m4: add missing stdio.h include.
+
+The next generation of C compilers is going to enforce the C standard
+more strictly:
+
+  https://wiki.gentoo.org/wiki/Modern_C_porting
+
+One warning that will eventually become an error is
+-Wimplicit-function-declaration. This is relatively easy to catch in
+most code (it will fail to compile), but inside of autoconf tests it
+can go unnoticed because many feature-test compilations fail by
+design. For example,
+
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <iconv.h>]],
+                 [[iconv_ccs_init(NULL, NULL);]])]...
+
+is designed to fail if iconv_ccs_init() is not in iconv.h. On the
+other hand,
+
+  AC_RUN_IFELSE([AC_LANG_SOURCE([[
+  #include <iconv.h>
+  int main() {
+    printf("%d", _libiconv_version);
+    return 0;
+  }
+
+should pass if _libiconv_version is defined. If the user has
+-Werror=implicit-function-declaration in his CFLAGS, however,
+it will not:
+
+  $ export CFLAGS="$CFLAGS -Werror=implicit-function-declaration"
+  $ ./configure
+  ...
+  checking if using GNU libiconv... no
+
+This is because the stdio.h header that defines printf() is missing:
+
+  conftest.c:240:3: error: implicit declaration of function 'printf'
+  [-Werror=implicit-function-declaration]
+    240 |   printf("%d", _libiconv_version);
+        |   ^~~~~~
+  conftest.c:239:1: note: include '<stdio.h>' or provide a declaration
+  of 'printf'
+
+This commit adds the include, correcting the test with any compiler
+that balks at implicit function definitions.
+
+(Backport to php-8.1.27)
+
+Closes GH-10751
+---
+ ext/iconv/config.m4 | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/ext/iconv/config.m4 b/ext/iconv/config.m4
+index ac57c81e..b8044bf2 100644
+--- a/ext/iconv/config.m4
++++ b/ext/iconv/config.m4
+@@ -30,6 +30,7 @@ if test "$PHP_ICONV" != "no"; then
+       AC_MSG_CHECKING([if using GNU libiconv])
+       AC_RUN_IFELSE([AC_LANG_SOURCE([[
+ #include <iconv.h>
++#include <stdio.h>
+ int main() {
+   printf("%d", _libiconv_version);
+   return 0;
+-- 
+2.43.0
+

diff --git a/dev-lang/php/php-8.1.27-r1.ebuild b/dev-lang/php/php-8.1.27-r2.ebuild
similarity index 99%
rename from dev-lang/php/php-8.1.27-r1.ebuild
rename to dev-lang/php/php-8.1.27-r2.ebuild
index ee3853ec5893..38bbbc21e31c 100644
--- a/dev-lang/php/php-8.1.27-r1.ebuild
+++ b/dev-lang/php/php-8.1.27-r2.ebuild
@@ -149,6 +149,7 @@ PATCHES=(
 	"${FILESDIR}/php-iodbc-header-location.patch"
 	"${FILESDIR}/php-capstone-optional.patch"
 	"${FILESDIR}/php-8.1.27-gcc14-libxml.patch"
+	"${FILESDIR}/php-8.1.27-implicit-decls.patch"
 )
 
 # ARM/Windows functions that are expected to be undefined.
@@ -158,6 +159,12 @@ QA_CONFIG_IMPL_DECL_SKIP=(
 	_controlfp_s
 )
 
+# Functions from alternate iconv implementations (bug 925268)
+QA_CONFIG_IMPL_DECL_SKIP+=(
+	iconv_ccs_init
+	cstoccsid
+)
+
 php_install_ini() {
 	local phpsapi="${1}"