aboutsummaryrefslogtreecommitdiffstats
path: root/meta-mentor-staging/meta-java/recipes-core/icedtea/icedtea7-native/0001-PR3597-Potential-bogus-Wformat-overflow-warning-with.patch
blob: ae75adb491c2e24d620196189c9fb7e689f95c6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
From 4163c0a0eb88263a3d3e593942cd9cf402909977 Mon Sep 17 00:00:00 2001
From: Christopher Larson <chris_larson@mentor.com>
Date: Mon, 5 Nov 2018 22:23:43 +0500
Subject: [PATCH] PR3597: Potential bogus -Wformat-overflow warning with
 -Wformat enabled

2018-05-29  Andrew John Hughes  <gnu_andrew@member.fsf.org>

	PR3597: Potential bogus -Wformat-overflow warning
	with -Wformat enabled
	* Makefile.am:
	(ICEDTEA_PATCHES): Add patch.
	* NEWS: Updated.
	* patches/pr3597.patch:
	Disable -Wformat-overflow on the
	the build_pipe_classes function with GCC >= 7 as it
	produces apparent false positives.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
---
 Makefile.am          |  4 ++++
 patches/pr3597.patch | 43 +++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 47 insertions(+)
 create mode 100644 patches/pr3597.patch

diff --git a/Makefile.am b/Makefile.am
index 5f0c90d..c1950b5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -277,6 +277,10 @@ else
 ICEDTEA_PATCHES += patches/nss-not-enabled-config.patch
 endif
 
+# Apply additional HotSpot patches against same patch base
+ICEDTEA_PATCHES += \
+	patches/pr3597.patch
+
 ICEDTEA_PATCHES += $(DISTRIBUTION_PATCHES)
 
 # Bootstrapping patches
diff --git a/patches/pr3597.patch b/patches/pr3597.patch
new file mode 100644
index 0000000..5e3b4ef
--- /dev/null
+++ b/patches/pr3597.patch
@@ -0,0 +1,43 @@
+diff --git openjdk.orig/hotspot/src/share/vm/adlc/adlc.hpp openjdk/hotspot/src/share/vm/adlc/adlc.hpp
+--- openjdk.orig/hotspot/src/share/vm/adlc/adlc.hpp
++++ openjdk/hotspot/src/share/vm/adlc/adlc.hpp
+@@ -85,6 +85,19 @@
+ #undef max
+ #define max(a, b)   (((a)>(b)) ? (a) : (b))
+ 
++#if !defined(__clang_major__) && (__GNUC__ >= 7)
++#define PRAGMA_DIAG_PUSH             _Pragma("GCC diagnostic push")
++#define PRAGMA_DIAG_POP              _Pragma("GCC diagnostic pop")
++#define PRAGMA_FORMAT_OVERFLOW_IGNORED _Pragma("GCC diagnostic ignored \"-Wformat-overflow\"")
++#define PRAGMA_FORMAT_OVERFLOW_IGNORED_EXTERNAL PRAGMA_FORMAT_OVERFLOW_IGNORED
++#define PRAGMA_FORMAT_OVERFLOW_IGNORED_INTERNAL PRAGMA_FORMAT_OVERFLOW_IGNORED
++#else
++#define PRAGMA_DIAG_PUSH
++#define PRAGMA_DIAG_POP
++#define PRAGMA_FORMAT_OVERFLOW_IGNORED_EXTERNAL
++#define PRAGMA_FORMAT_OVERFLOW_IGNORED_INTERNAL
++#endif
++
+ // ADLC components
+ #include "arena.hpp"
+ #include "opto/adlcVMDeps.hpp"
+diff --git openjdk.orig/hotspot/src/share/vm/adlc/output_c.cpp openjdk/hotspot/src/share/vm/adlc/output_c.cpp
+--- openjdk.orig/hotspot/src/share/vm/adlc/output_c.cpp
++++ openjdk/hotspot/src/share/vm/adlc/output_c.cpp
+@@ -560,6 +560,8 @@
+   return (ndx);
+ }
+ 
++PRAGMA_DIAG_PUSH
++PRAGMA_FORMAT_OVERFLOW_IGNORED_EXTERNAL
+ void ArchDesc::build_pipe_classes(FILE *fp_cpp) {
+   const char *classname;
+   const char *resourcename;
+@@ -1016,6 +1018,7 @@
+   fprintf(fp_cpp, "}\n");
+   fprintf(fp_cpp, "#endif\n");
+ }
++PRAGMA_DIAG_POP
+ 
+ // ---------------------------------------------------------------------------
+ //------------------------------Utilities to build Instruction Classes--------