commit 249939d: [Minor] Add missing <algorithm> include for gcc 14

Petr Vaněk arkamar at atlas.cz
Wed Nov 1 11:07:03 UTC 2023


Author: Petr Vaněk
Date: 2023-11-01 11:28:53 +0100
URL: https://github.com/rspamd/rspamd/commit/249939dfcb2244ba83d5ceb2b50a0429f53b23f1 (refs/pull/4675/head)

[Minor] Add missing <algorithm> include for gcc 14
This commit addresses a compilation issue when using GCC 14. According
to GCC 14's porting guide [1], some C++ Standard Library headers no
longer include other headers they used to use internally. Specifically,
<algorithm> must now be explicitly included.

[1] https://gcc.gnu.org/gcc-14/porting_to.html

See-also: https://bugs.gentoo.org/916438
Signed-off-by: Petr Vaněk <arkamar at atlas.cz>

---
 src/libmime/mime_string.hxx           | 1 +
 src/libstat/backends/http_backend.cxx | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/libmime/mime_string.hxx b/src/libmime/mime_string.hxx
index 583a2c903..7476816c6 100644
--- a/src/libmime/mime_string.hxx
+++ b/src/libmime/mime_string.hxx
@@ -17,6 +17,7 @@
 #define RSPAMD_MIME_STRING_HXX
 #pragma once
 
+#include <algorithm>
 #include <string>
 #include <string_view>
 #include <memory>
diff --git a/src/libstat/backends/http_backend.cxx b/src/libstat/backends/http_backend.cxx
index 3b2e3efe0..075e50870 100644
--- a/src/libstat/backends/http_backend.cxx
+++ b/src/libstat/backends/http_backend.cxx
@@ -20,6 +20,7 @@
 #include "libserver/mempool_vars_internal.h"
 #include "upstream.h"
 #include "contrib/ankerl/unordered_dense.h"
+#include <algorithm>
 #include <vector>
 
 namespace rspamd::stat::http {


More information about the Commits mailing list