MSYS2-packages/gcc/0403-fix-build-pretty-print.patch
مهدي شينون (Mehdi Chinoune) 152f0c1987 gcc: update to 15.1.0
2025-06-26 09:34:37 +02:00

59 lines
1.8 KiB
Diff

From 2f0a91e8fa610e355ef947c6b284dbe62664ffb5 Mon Sep 17 00:00:00 2001
From: Achim Gratz <Achim.Gratz@Stromeko.DE>
Date: Mon, 10 Feb 2025 18:39:22 +0100
Subject: [PATCH 403/404] fix build: pretty-print
---
gcc/config/i386/host-cygwin.cc | 2 ++
gcc/pretty-print.cc | 8 ++++++++
2 files changed, 10 insertions(+)
diff --git a/gcc/config/i386/host-cygwin.cc b/gcc/config/i386/host-cygwin.cc
index d131cfe70f9..f207826456d 100644
--- a/gcc/config/i386/host-cygwin.cc
+++ b/gcc/config/i386/host-cygwin.cc
@@ -20,6 +20,8 @@
#define IN_TARGET_CODE 1
#include "config.h"
+#define INCLUDE_MEMORY
+#define INCLUDE_VECTOR
#include "system.h"
#include "coretypes.h"
#include "diagnostic.h"
diff --git a/gcc/pretty-print.cc b/gcc/pretty-print.cc
index abd6c0b528f..ba40a1f157d 100644
--- a/gcc/pretty-print.cc
+++ b/gcc/pretty-print.cc
@@ -3556,8 +3556,12 @@ test_custom_tokens_1 ()
ASSERT_EQ (e1.m_num_living_values, 0);
ASSERT_EQ (e2.m_num_living_values, 0);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wformat-extra-args"
pretty_printer pp;
pp_printf (&pp, "before %e middle %e after", &e1, &e2);
+#pragma GCC diagnostic pop
/* Verify that instances were cleaned up. */
ASSERT_EQ (e1.m_num_living_values, 0);
@@ -3693,10 +3697,14 @@ test_custom_tokens_2 ()
ASSERT_EQ (e1.m_num_living_values, 0);
ASSERT_EQ (e2.m_num_living_values, 0);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wformat"
+#pragma GCC diagnostic ignored "-Wformat-extra-args"
custom_token_printer tp;
pretty_printer pp;
pp.set_token_printer (&tp);
pp_printf (&pp, "before %e middle %e after", &e1, &e2);
+#pragma GCC diagnostic pop
/* Verify that instances were cleaned up. */
ASSERT_EQ (e1.m_num_living_values, 0);
--
2.45.1