From aeedb7c5cdd4108159e8fb64b79830e4651af6a2 Mon Sep 17 00:00:00 2001
From: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Date: Thu, 4 Dec 2025 09:18:24 +0000
Subject: [PATCH v1] Suppress strict-prototypes warnings from readline headers

---
 src/bin/psql/input.h | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
 100.0% src/bin/psql/

diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h
index 6b2f84e0d0c..fe9cc5f9769 100644
--- a/src/bin/psql/input.h
+++ b/src/bin/psql/input.h
@@ -17,6 +17,16 @@
 #ifdef HAVE_LIBREADLINE
 #define USE_READLINE 1
 
+/*
+ * Suppress strict-prototypes warnings from readline headers.
+ * Some readline implementations have old-style function declarations
+ * that trigger -Wstrict-prototypes, which we can't fix in third party code.
+ */
+#if defined(__GNUC__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstrict-prototypes"
+#endif
+
 #if defined(HAVE_READLINE_READLINE_H)
 #include <readline/readline.h>
 #if defined(HAVE_READLINE_HISTORY_H)
@@ -33,6 +43,11 @@
 #include <history.h>
 #endif
 #endif							/* HAVE_READLINE_READLINE_H, etc */
+
+#if defined(__GNUC__)
+#pragma GCC diagnostic pop
+#endif
+
 #endif							/* HAVE_LIBREADLINE */
 
 #include "pqexpbuffer.h"
-- 
2.34.1

