From 9cf0a89e1c3c2b47b82f990c98319e87670096cd Mon Sep 17 00:00:00 2001 From: Daniel Bevenius Date: Mon, 31 Aug 2026 15:39:39 +0200 Subject: [PATCH] squash! ggml : attempt to fix use of std::hardware_destructive_inference_size Add a version check for GCC 12 to conditionally apply the `-Winterference-size` pragma. --- ggml/src/ggml-cpu/ops.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ggml/src/ggml-cpu/ops.h b/ggml/src/ggml-cpu/ops.h index a2c6b51978..ce2b3e870b 100644 --- a/ggml/src/ggml-cpu/ops.h +++ b/ggml/src/ggml-cpu/ops.h @@ -18,12 +18,13 @@ #endif #endif -#if defined(__cplusplus) && defined(__GNUC__) && !defined(__clang__) +// -Winterference-size was introduced in GCC 12 +#if defined(__cplusplus) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 12 #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Winterference-size" #endif static const size_t CACHE_LINE_SIZE_F32 = CACHE_LINE_SIZE/sizeof(float); -#if defined(__cplusplus) && defined(__GNUC__) && !defined(__clang__) +#if defined(__cplusplus) && defined(__GNUC__) && !defined(__clang__) && __GNUC__ >= 12 #pragma GCC diagnostic pop #endif