diff options
Diffstat (limited to 'recipes-core/openjdk/patches-openjdk-8/1007-hotspot-Turn-on-the-Wreturn-type-warning.patch')
-rw-r--r-- | recipes-core/openjdk/patches-openjdk-8/1007-hotspot-Turn-on-the-Wreturn-type-warning.patch | 237 |
1 files changed, 237 insertions, 0 deletions
diff --git a/recipes-core/openjdk/patches-openjdk-8/1007-hotspot-Turn-on-the-Wreturn-type-warning.patch b/recipes-core/openjdk/patches-openjdk-8/1007-hotspot-Turn-on-the-Wreturn-type-warning.patch new file mode 100644 index 0000000..b1b59c3 --- /dev/null +++ b/recipes-core/openjdk/patches-openjdk-8/1007-hotspot-Turn-on-the-Wreturn-type-warning.patch | |||
@@ -0,0 +1,237 @@ | |||
1 | From 6758bf27e31110dc5d4c7237476c823ff05454a2 Mon Sep 17 00:00:00 2001 | ||
2 | From: Richard Leitner <richard.leitner@skidata.com> | ||
3 | Date: Thu, 22 Oct 2020 09:41:07 +0200 | ||
4 | Subject: [PATCH] hotspot: Turn on the -Wreturn-type warning | ||
5 | MIME-Version: 1.0 | ||
6 | Content-Type: text/plain; charset=UTF-8 | ||
7 | Content-Transfer-Encoding: 8bit | ||
8 | |||
9 | MIME-Version: 1.0 | ||
10 | Content-Type: text/plain; charset=UTF-8 | ||
11 | Content-Transfer-Encoding: 8bit | ||
12 | |||
13 | |# HG changeset patch | ||
14 | |# User stefank | ||
15 | |# Date 1525453613 -3600 | ||
16 | |# Fri May 04 18:06:53 2018 +0100 | ||
17 | |# Node ID 07a1135a327362f157955d470fad5df07cc35164 | ||
18 | |# Parent de79964656fc652f2085dac4fe99bcc128b5a3b1 | ||
19 | 8062808, PR3548: Turn on the -Wreturn-type warning | ||
20 | Reviewed-by: mgerdin, tschatzl, coleenp, jrose, kbarrett | ||
21 | |||
22 | Upstream-Status: Backport | ||
23 | |||
24 | Signed-off-by: André Draszik <andre.draszik@jci.com> | ||
25 | Signed-off-by: Richard Leitner <richard.leitner@skidata.com> | ||
26 | |||
27 | --- | ||
28 | hotspot/make/linux/makefiles/gcc.make | 2 +- | ||
29 | hotspot/src/cpu/x86/vm/x86_32.ad | 1 + | ||
30 | hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp | 1 + | ||
31 | hotspot/src/share/vm/classfile/defaultMethods.cpp | 4 ++-- | ||
32 | hotspot/src/share/vm/classfile/symbolTable.cpp | 4 ++-- | ||
33 | hotspot/src/share/vm/classfile/systemDictionary.cpp | 6 +++--- | ||
34 | hotspot/src/share/vm/memory/heapInspection.hpp | 2 +- | ||
35 | hotspot/src/share/vm/memory/metaspaceShared.hpp | 2 +- | ||
36 | hotspot/src/share/vm/oops/constantPool.hpp | 2 +- | ||
37 | hotspot/src/share/vm/prims/jvm.cpp | 2 +- | ||
38 | hotspot/src/share/vm/runtime/reflection.cpp | 2 +- | ||
39 | hotspot/src/share/vm/runtime/sharedRuntime.cpp | 2 +- | ||
40 | hotspot/src/share/vm/services/memTracker.hpp | 2 +- | ||
41 | 13 files changed, 17 insertions(+), 15 deletions(-) | ||
42 | |||
43 | diff --git a/hotspot/make/linux/makefiles/gcc.make b/hotspot/make/linux/makefiles/gcc.make | ||
44 | index 36b3c8ba..cd9511e5 100644 | ||
45 | --- a/hotspot/make/linux/makefiles/gcc.make | ||
46 | +++ b/hotspot/make/linux/makefiles/gcc.make | ||
47 | @@ -211,7 +211,7 @@ ifeq ($(USE_CLANG), true) | ||
48 | WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body | ||
49 | endif | ||
50 | |||
51 | -WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value | ||
52 | +WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wreturn-type | ||
53 | |||
54 | ifeq ($(USE_CLANG),) | ||
55 | # Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit | ||
56 | diff --git a/hotspot/src/cpu/x86/vm/x86_32.ad b/hotspot/src/cpu/x86/vm/x86_32.ad | ||
57 | index f42d1a28..c8f4ee16 100644 | ||
58 | --- a/hotspot/src/cpu/x86/vm/x86_32.ad | ||
59 | +++ b/hotspot/src/cpu/x86/vm/x86_32.ad | ||
60 | @@ -1250,6 +1250,7 @@ uint MachSpillCopyNode::implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bo | ||
61 | |||
62 | |||
63 | Unimplemented(); | ||
64 | + return 0; // Mute compiler | ||
65 | } | ||
66 | |||
67 | #ifndef PRODUCT | ||
68 | diff --git a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp | ||
69 | index c35d8677..65c3165c 100644 | ||
70 | --- a/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp | ||
71 | +++ b/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp | ||
72 | @@ -541,6 +541,7 @@ JVM_handle_linux_signal(int sig, | ||
73 | err.report_and_die(); | ||
74 | |||
75 | ShouldNotReachHere(); | ||
76 | + return true; // Mute compiler | ||
77 | } | ||
78 | |||
79 | void os::Linux::init_thread_fpu_state(void) { | ||
80 | diff --git a/hotspot/src/share/vm/classfile/defaultMethods.cpp b/hotspot/src/share/vm/classfile/defaultMethods.cpp | ||
81 | index 4b4b4e25..196622ae 100644 | ||
82 | --- a/hotspot/src/share/vm/classfile/defaultMethods.cpp | ||
83 | +++ b/hotspot/src/share/vm/classfile/defaultMethods.cpp | ||
84 | @@ -506,7 +506,7 @@ Symbol* MethodFamily::generate_method_message(Symbol *klass_name, Method* method | ||
85 | ss.write((const char*)name->bytes(), name->utf8_length()); | ||
86 | ss.write((const char*)signature->bytes(), signature->utf8_length()); | ||
87 | ss.print(" is abstract"); | ||
88 | - return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL); | ||
89 | + return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD); | ||
90 | } | ||
91 | |||
92 | Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods, TRAPS) const { | ||
93 | @@ -521,7 +521,7 @@ Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods | ||
94 | ss.print("."); | ||
95 | ss.write((const char*)name->bytes(), name->utf8_length()); | ||
96 | } | ||
97 | - return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL); | ||
98 | + return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD); | ||
99 | } | ||
100 | |||
101 | |||
102 | diff --git a/hotspot/src/share/vm/classfile/symbolTable.cpp b/hotspot/src/share/vm/classfile/symbolTable.cpp | ||
103 | index 83369cbc..8dd4e6b2 100644 | ||
104 | --- a/hotspot/src/share/vm/classfile/symbolTable.cpp | ||
105 | +++ b/hotspot/src/share/vm/classfile/symbolTable.cpp | ||
106 | @@ -249,7 +249,7 @@ Symbol* SymbolTable::lookup(const char* name, int len, TRAPS) { | ||
107 | MutexLocker ml(SymbolTable_lock, THREAD); | ||
108 | |||
109 | // Otherwise, add to symbol to table | ||
110 | - return the_table()->basic_add(index, (u1*)name, len, hashValue, true, CHECK_NULL); | ||
111 | + return the_table()->basic_add(index, (u1*)name, len, hashValue, true, THREAD); | ||
112 | } | ||
113 | |||
114 | Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) { | ||
115 | @@ -288,7 +288,7 @@ Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) { | ||
116 | // Grab SymbolTable_lock first. | ||
117 | MutexLocker ml(SymbolTable_lock, THREAD); | ||
118 | |||
119 | - return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, CHECK_NULL); | ||
120 | + return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, THREAD); | ||
121 | } | ||
122 | |||
123 | Symbol* SymbolTable::lookup_only(const char* name, int len, | ||
124 | diff --git a/hotspot/src/share/vm/classfile/systemDictionary.cpp b/hotspot/src/share/vm/classfile/systemDictionary.cpp | ||
125 | index 4541e815..98412e1e 100644 | ||
126 | --- a/hotspot/src/share/vm/classfile/systemDictionary.cpp | ||
127 | +++ b/hotspot/src/share/vm/classfile/systemDictionary.cpp | ||
128 | @@ -236,15 +236,15 @@ Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader | ||
129 | class_name->as_C_string(), | ||
130 | class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string())); | ||
131 | if (FieldType::is_array(class_name)) { | ||
132 | - return resolve_array_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL); | ||
133 | + return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD); | ||
134 | } else if (FieldType::is_obj(class_name)) { | ||
135 | ResourceMark rm(THREAD); | ||
136 | // Ignore wrapping L and ;. | ||
137 | TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1, | ||
138 | class_name->utf8_length() - 2, CHECK_NULL); | ||
139 | - return resolve_instance_class_or_null(name, class_loader, protection_domain, CHECK_NULL); | ||
140 | + return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD); | ||
141 | } else { | ||
142 | - return resolve_instance_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL); | ||
143 | + return resolve_instance_class_or_null(class_name, class_loader, protection_domain, THREAD); | ||
144 | } | ||
145 | } | ||
146 | |||
147 | diff --git a/hotspot/src/share/vm/memory/heapInspection.hpp b/hotspot/src/share/vm/memory/heapInspection.hpp | ||
148 | index 09ee6602..c5fec15c 100644 | ||
149 | --- a/hotspot/src/share/vm/memory/heapInspection.hpp | ||
150 | +++ b/hotspot/src/share/vm/memory/heapInspection.hpp | ||
151 | @@ -367,7 +367,7 @@ class HeapInspection : public StackObj { | ||
152 | _csv_format(csv_format), _print_help(print_help), | ||
153 | _print_class_stats(print_class_stats), _columns(columns) {} | ||
154 | void heap_inspection(outputStream* st) NOT_SERVICES_RETURN; | ||
155 | - size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN; | ||
156 | + size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN_(0); | ||
157 | static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN; | ||
158 | private: | ||
159 | void iterate_over_heap(KlassInfoTable* cit, BoolObjectClosure* filter = NULL); | ||
160 | diff --git a/hotspot/src/share/vm/memory/metaspaceShared.hpp b/hotspot/src/share/vm/memory/metaspaceShared.hpp | ||
161 | index 2f3abae6..d58ebecb 100644 | ||
162 | --- a/hotspot/src/share/vm/memory/metaspaceShared.hpp | ||
163 | +++ b/hotspot/src/share/vm/memory/metaspaceShared.hpp | ||
164 | @@ -93,7 +93,7 @@ class MetaspaceShared : AllStatic { | ||
165 | static void preload_and_dump(TRAPS) NOT_CDS_RETURN; | ||
166 | static int preload_and_dump(const char * class_list_path, | ||
167 | GrowableArray<Klass*>* class_promote_order, | ||
168 | - TRAPS) NOT_CDS_RETURN; | ||
169 | + TRAPS) NOT_CDS_RETURN_(0); | ||
170 | |||
171 | static ReservedSpace* shared_rs() { | ||
172 | CDS_ONLY(return _shared_rs); | ||
173 | diff --git a/hotspot/src/share/vm/oops/constantPool.hpp b/hotspot/src/share/vm/oops/constantPool.hpp | ||
174 | index 68435471..fad4a92c 100644 | ||
175 | --- a/hotspot/src/share/vm/oops/constantPool.hpp | ||
176 | +++ b/hotspot/src/share/vm/oops/constantPool.hpp | ||
177 | @@ -350,7 +350,7 @@ class ConstantPool : public Metadata { | ||
178 | |||
179 | Klass* klass_at(int which, TRAPS) { | ||
180 | constantPoolHandle h_this(THREAD, this); | ||
181 | - return klass_at_impl(h_this, which, CHECK_NULL); | ||
182 | + return klass_at_impl(h_this, which, THREAD); | ||
183 | } | ||
184 | |||
185 | Symbol* klass_name_at(int which) const; // Returns the name, w/o resolving. | ||
186 | diff --git a/hotspot/src/share/vm/prims/jvm.cpp b/hotspot/src/share/vm/prims/jvm.cpp | ||
187 | index 6f2221c4..daa69f89 100644 | ||
188 | --- a/hotspot/src/share/vm/prims/jvm.cpp | ||
189 | +++ b/hotspot/src/share/vm/prims/jvm.cpp | ||
190 | @@ -4368,7 +4368,7 @@ JVM_ENTRY(jlong,JVM_DTraceActivate( | ||
191 | JVM_DTraceProvider* providers)) | ||
192 | JVMWrapper("JVM_DTraceActivate"); | ||
193 | return DTraceJSDT::activate( | ||
194 | - version, module_name, providers_count, providers, CHECK_0); | ||
195 | + version, module_name, providers_count, providers, THREAD); | ||
196 | JVM_END | ||
197 | |||
198 | JVM_ENTRY(jboolean,JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method)) | ||
199 | diff --git a/hotspot/src/share/vm/runtime/reflection.cpp b/hotspot/src/share/vm/runtime/reflection.cpp | ||
200 | index 4b39d8cc..9cd7b0dc 100644 | ||
201 | --- a/hotspot/src/share/vm/runtime/reflection.cpp | ||
202 | +++ b/hotspot/src/share/vm/runtime/reflection.cpp | ||
203 | @@ -1093,7 +1093,7 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method, | ||
204 | } else { | ||
205 | if (rtype == T_BOOLEAN || rtype == T_BYTE || rtype == T_CHAR || rtype == T_SHORT) | ||
206 | narrow((jvalue*) result.get_value_addr(), rtype, CHECK_NULL); | ||
207 | - return box((jvalue*) result.get_value_addr(), rtype, CHECK_NULL); | ||
208 | + return box((jvalue*) result.get_value_addr(), rtype, THREAD); | ||
209 | } | ||
210 | } | ||
211 | |||
212 | diff --git a/hotspot/src/share/vm/runtime/sharedRuntime.cpp b/hotspot/src/share/vm/runtime/sharedRuntime.cpp | ||
213 | index d5bea29c..50578ad6 100644 | ||
214 | --- a/hotspot/src/share/vm/runtime/sharedRuntime.cpp | ||
215 | +++ b/hotspot/src/share/vm/runtime/sharedRuntime.cpp | ||
216 | @@ -1041,7 +1041,7 @@ Handle SharedRuntime::find_callee_info(JavaThread* thread, Bytecodes::Code& bc, | ||
217 | // last java frame on stack (which includes native call frames) | ||
218 | vframeStream vfst(thread, true); // Do not skip and javaCalls | ||
219 | |||
220 | - return find_callee_info_helper(thread, vfst, bc, callinfo, CHECK_(Handle())); | ||
221 | + return find_callee_info_helper(thread, vfst, bc, callinfo, THREAD); | ||
222 | } | ||
223 | |||
224 | |||
225 | diff --git a/hotspot/src/share/vm/services/memTracker.hpp b/hotspot/src/share/vm/services/memTracker.hpp | ||
226 | index 8ea859dd..535147f8 100644 | ||
227 | --- a/hotspot/src/share/vm/services/memTracker.hpp | ||
228 | +++ b/hotspot/src/share/vm/services/memTracker.hpp | ||
229 | @@ -64,7 +64,7 @@ class MemTracker : AllStatic { | ||
230 | const NativeCallStack& stack, MEMFLAGS flag = mtNone) { } | ||
231 | static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { } | ||
232 | static inline Tracker get_virtual_memory_uncommit_tracker() { return Tracker(); } | ||
233 | - static inline Tracker get_virtual_memory_release_tracker() { } | ||
234 | + static inline Tracker get_virtual_memory_release_tracker() { return Tracker(); } | ||
235 | static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { } | ||
236 | static inline void record_thread_stack(void* addr, size_t size) { } | ||
237 | static inline void release_thread_stack(void* addr, size_t size) { } | ||