From fb151c8662098ad2b42936402b86930a4eae97b4 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max.kellermann@gmail.com>
Date: Mon, 29 Jul 2024 22:08:54 +0200
Subject: [PATCH] lib/fmt/meson.build: suppress -Warray-bounds with GCC 13

---
 src/lib/fmt/meson.build | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/lib/fmt/meson.build b/src/lib/fmt/meson.build
index 77c2ef189..87bbea076 100644
--- a/src/lib/fmt/meson.build
+++ b/src/lib/fmt/meson.build
@@ -1,5 +1,14 @@
 libfmt = dependency('fmt', version: '>= 9', fallback: ['fmt', 'fmt_dep'])
 
+
+if compiler.get_id() == 'gcc' and compiler.version().version_compare('>=13') and compiler.version().version_compare('<14')
+  libfmt = declare_dependency(
+    dependencies: libfmt,
+    # suppress bogus GCC 13 warning: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109717
+    compile_args: ['-Wno-array-bounds'],
+  )
+endif
+
 fmt = static_library(
   'fmt',
   'ExceptionFormatter.cxx',