8062808: Turn on the -Wreturn-type warning
Reviewed-by: mgerdin, tschatzl, coleenp, jrose, kbarrett
This commit is contained in:
parent
f9d8e2ae9d
commit
692dbfd02d
@ -214,7 +214,7 @@ ifeq ($(USE_CLANG), true)
|
|||||||
WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
|
WARNINGS_ARE_ERRORS += -Wno-return-type -Wno-empty-body
|
||||||
endif
|
endif
|
||||||
|
|
||||||
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2
|
WARNING_FLAGS = -Wpointer-arith -Wsign-compare -Wundef -Wunused-function -Wunused-value -Wformat=2 -Wreturn-type
|
||||||
|
|
||||||
ifeq ($(USE_CLANG),)
|
ifeq ($(USE_CLANG),)
|
||||||
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
|
# Since GCC 4.3, -Wconversion has changed its meanings to warn these implicit
|
||||||
|
@ -1210,6 +1210,7 @@ uint MachSpillCopyNode::implementation( CodeBuffer *cbuf, PhaseRegAlloc *ra_, bo
|
|||||||
|
|
||||||
|
|
||||||
Unimplemented();
|
Unimplemented();
|
||||||
|
return 0; // Mute compiler
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef PRODUCT
|
#ifndef PRODUCT
|
||||||
|
@ -542,6 +542,7 @@ JVM_handle_linux_signal(int sig,
|
|||||||
err.report_and_die();
|
err.report_and_die();
|
||||||
|
|
||||||
ShouldNotReachHere();
|
ShouldNotReachHere();
|
||||||
|
return true; // Mute compiler
|
||||||
}
|
}
|
||||||
|
|
||||||
void os::Linux::init_thread_fpu_state(void) {
|
void os::Linux::init_thread_fpu_state(void) {
|
||||||
|
@ -506,7 +506,7 @@ Symbol* MethodFamily::generate_method_message(Symbol *klass_name, Method* method
|
|||||||
ss.write((const char*)name->bytes(), name->utf8_length());
|
ss.write((const char*)name->bytes(), name->utf8_length());
|
||||||
ss.write((const char*)signature->bytes(), signature->utf8_length());
|
ss.write((const char*)signature->bytes(), signature->utf8_length());
|
||||||
ss.print(" is abstract");
|
ss.print(" is abstract");
|
||||||
return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
|
return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods, TRAPS) const {
|
Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods, TRAPS) const {
|
||||||
@ -521,7 +521,7 @@ Symbol* MethodFamily::generate_conflicts_message(GrowableArray<Method*>* methods
|
|||||||
ss.print(".");
|
ss.print(".");
|
||||||
ss.write((const char*)name->bytes(), name->utf8_length());
|
ss.write((const char*)name->bytes(), name->utf8_length());
|
||||||
}
|
}
|
||||||
return SymbolTable::new_symbol(ss.base(), (int)ss.size(), CHECK_NULL);
|
return SymbolTable::new_symbol(ss.base(), (int)ss.size(), THREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -235,7 +235,7 @@ Symbol* SymbolTable::lookup(const char* name, int len, TRAPS) {
|
|||||||
MutexLocker ml(SymbolTable_lock, THREAD);
|
MutexLocker ml(SymbolTable_lock, THREAD);
|
||||||
|
|
||||||
// Otherwise, add to symbol to table
|
// Otherwise, add to symbol to table
|
||||||
return the_table()->basic_add(index, (u1*)name, len, hashValue, true, CHECK_NULL);
|
return the_table()->basic_add(index, (u1*)name, len, hashValue, true, THREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) {
|
Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) {
|
||||||
@ -274,7 +274,7 @@ Symbol* SymbolTable::lookup(const Symbol* sym, int begin, int end, TRAPS) {
|
|||||||
// Grab SymbolTable_lock first.
|
// Grab SymbolTable_lock first.
|
||||||
MutexLocker ml(SymbolTable_lock, THREAD);
|
MutexLocker ml(SymbolTable_lock, THREAD);
|
||||||
|
|
||||||
return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, CHECK_NULL);
|
return the_table()->basic_add(index, (u1*)buffer, len, hashValue, true, THREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
Symbol* SymbolTable::lookup_only(const char* name, int len,
|
Symbol* SymbolTable::lookup_only(const char* name, int len,
|
||||||
|
@ -233,15 +233,15 @@ Klass* SystemDictionary::resolve_or_null(Symbol* class_name, Handle class_loader
|
|||||||
class_name->as_C_string(),
|
class_name->as_C_string(),
|
||||||
class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string()));
|
class_loader.is_null() ? "null" : class_loader->klass()->name()->as_C_string()));
|
||||||
if (FieldType::is_array(class_name)) {
|
if (FieldType::is_array(class_name)) {
|
||||||
return resolve_array_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL);
|
return resolve_array_class_or_null(class_name, class_loader, protection_domain, THREAD);
|
||||||
} else if (FieldType::is_obj(class_name)) {
|
} else if (FieldType::is_obj(class_name)) {
|
||||||
ResourceMark rm(THREAD);
|
ResourceMark rm(THREAD);
|
||||||
// Ignore wrapping L and ;.
|
// Ignore wrapping L and ;.
|
||||||
TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1,
|
TempNewSymbol name = SymbolTable::new_symbol(class_name->as_C_string() + 1,
|
||||||
class_name->utf8_length() - 2, CHECK_NULL);
|
class_name->utf8_length() - 2, CHECK_NULL);
|
||||||
return resolve_instance_class_or_null(name, class_loader, protection_domain, CHECK_NULL);
|
return resolve_instance_class_or_null(name, class_loader, protection_domain, THREAD);
|
||||||
} else {
|
} else {
|
||||||
return resolve_instance_class_or_null(class_name, class_loader, protection_domain, CHECK_NULL);
|
return resolve_instance_class_or_null(class_name, class_loader, protection_domain, THREAD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -367,7 +367,7 @@ class HeapInspection : public StackObj {
|
|||||||
_csv_format(csv_format), _print_help(print_help),
|
_csv_format(csv_format), _print_help(print_help),
|
||||||
_print_class_stats(print_class_stats), _columns(columns) {}
|
_print_class_stats(print_class_stats), _columns(columns) {}
|
||||||
void heap_inspection(outputStream* st) NOT_SERVICES_RETURN;
|
void heap_inspection(outputStream* st) NOT_SERVICES_RETURN;
|
||||||
size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN;
|
size_t populate_table(KlassInfoTable* cit, BoolObjectClosure* filter = NULL) NOT_SERVICES_RETURN_(0);
|
||||||
static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN;
|
static void find_instances_at_safepoint(Klass* k, GrowableArray<oop>* result) NOT_SERVICES_RETURN;
|
||||||
private:
|
private:
|
||||||
void iterate_over_heap(KlassInfoTable* cit, BoolObjectClosure* filter = NULL);
|
void iterate_over_heap(KlassInfoTable* cit, BoolObjectClosure* filter = NULL);
|
||||||
|
@ -92,7 +92,7 @@ class MetaspaceShared : AllStatic {
|
|||||||
static void preload_and_dump(TRAPS) NOT_CDS_RETURN;
|
static void preload_and_dump(TRAPS) NOT_CDS_RETURN;
|
||||||
static int preload_and_dump(const char * class_list_path,
|
static int preload_and_dump(const char * class_list_path,
|
||||||
GrowableArray<Klass*>* class_promote_order,
|
GrowableArray<Klass*>* class_promote_order,
|
||||||
TRAPS) NOT_CDS_RETURN;
|
TRAPS) NOT_CDS_RETURN_(0);
|
||||||
|
|
||||||
static ReservedSpace* shared_rs() {
|
static ReservedSpace* shared_rs() {
|
||||||
CDS_ONLY(return _shared_rs);
|
CDS_ONLY(return _shared_rs);
|
||||||
|
@ -336,13 +336,13 @@ class ConstantPool : public Metadata {
|
|||||||
|
|
||||||
Klass* klass_at(int which, TRAPS) {
|
Klass* klass_at(int which, TRAPS) {
|
||||||
constantPoolHandle h_this(THREAD, this);
|
constantPoolHandle h_this(THREAD, this);
|
||||||
return klass_at_impl(h_this, which, true, CHECK_NULL);
|
return klass_at_impl(h_this, which, true, THREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Version of klass_at that doesn't save the resolution error, called during deopt
|
// Version of klass_at that doesn't save the resolution error, called during deopt
|
||||||
Klass* klass_at_ignore_error(int which, TRAPS) {
|
Klass* klass_at_ignore_error(int which, TRAPS) {
|
||||||
constantPoolHandle h_this(THREAD, this);
|
constantPoolHandle h_this(THREAD, this);
|
||||||
return klass_at_impl(h_this, which, false, CHECK_NULL);
|
return klass_at_impl(h_this, which, false, THREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
Symbol* klass_name_at(int which); // Returns the name, w/o resolving.
|
Symbol* klass_name_at(int which); // Returns the name, w/o resolving.
|
||||||
|
@ -3537,7 +3537,7 @@ JVM_ENTRY(jlong,JVM_DTraceActivate(
|
|||||||
JVM_DTraceProvider* providers))
|
JVM_DTraceProvider* providers))
|
||||||
JVMWrapper("JVM_DTraceActivate");
|
JVMWrapper("JVM_DTraceActivate");
|
||||||
return DTraceJSDT::activate(
|
return DTraceJSDT::activate(
|
||||||
version, module_name, providers_count, providers, CHECK_0);
|
version, module_name, providers_count, providers, THREAD);
|
||||||
JVM_END
|
JVM_END
|
||||||
|
|
||||||
JVM_ENTRY(jboolean,JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method))
|
JVM_ENTRY(jboolean,JVM_DTraceIsProbeEnabled(JNIEnv* env, jmethodID method))
|
||||||
|
@ -1004,7 +1004,7 @@ oop Reflection::invoke(instanceKlassHandle klass, methodHandle reflected_method,
|
|||||||
} else {
|
} else {
|
||||||
if (rtype == T_BOOLEAN || rtype == T_BYTE || rtype == T_CHAR || rtype == T_SHORT)
|
if (rtype == T_BOOLEAN || rtype == T_BYTE || rtype == T_CHAR || rtype == T_SHORT)
|
||||||
narrow((jvalue*) result.get_value_addr(), rtype, CHECK_NULL);
|
narrow((jvalue*) result.get_value_addr(), rtype, CHECK_NULL);
|
||||||
return box((jvalue*) result.get_value_addr(), rtype, CHECK_NULL);
|
return box((jvalue*) result.get_value_addr(), rtype, THREAD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -986,7 +986,7 @@ Handle SharedRuntime::find_callee_info(JavaThread* thread, Bytecodes::Code& bc,
|
|||||||
// last java frame on stack (which includes native call frames)
|
// last java frame on stack (which includes native call frames)
|
||||||
vframeStream vfst(thread, true); // Do not skip and javaCalls
|
vframeStream vfst(thread, true); // Do not skip and javaCalls
|
||||||
|
|
||||||
return find_callee_info_helper(thread, vfst, bc, callinfo, CHECK_(Handle()));
|
return find_callee_info_helper(thread, vfst, bc, callinfo, THREAD);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@ class MemTracker : AllStatic {
|
|||||||
const NativeCallStack& stack, MEMFLAGS flag = mtNone) { }
|
const NativeCallStack& stack, MEMFLAGS flag = mtNone) { }
|
||||||
static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { }
|
static inline void record_virtual_memory_commit(void* addr, size_t size, const NativeCallStack& stack) { }
|
||||||
static inline Tracker get_virtual_memory_uncommit_tracker() { return Tracker(); }
|
static inline Tracker get_virtual_memory_uncommit_tracker() { return Tracker(); }
|
||||||
static inline Tracker get_virtual_memory_release_tracker() { }
|
static inline Tracker get_virtual_memory_release_tracker() { return Tracker(); }
|
||||||
static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { }
|
static inline void record_virtual_memory_type(void* addr, MEMFLAGS flag) { }
|
||||||
static inline void record_thread_stack(void* addr, size_t size) { }
|
static inline void record_thread_stack(void* addr, size_t size) { }
|
||||||
static inline void release_thread_stack(void* addr, size_t size) { }
|
static inline void release_thread_stack(void* addr, size_t size) { }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user