Blame SOURCES/8143245-pr3548.patch

605045
# HG changeset patch
605045
# User sgehwolf
605045
# Date 1525714161 -3600
605045
#      Mon May 07 18:29:21 2018 +0100
605045
# Node ID afb31413c73cbc06420fdb447aa90a7a38258904
605045
# Parent  bcbc64dfb629c5f188bbf59b8f986ad95963ed60
605045
8143245, PR3548: Zero build requires disabled warnings
605045
Reviewed-by: dholmes, coleenp
605045
605045
diff --git openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make openjdk/hotspot/make/linux/makefiles/zeroshark.make
605045
--- openjdk.orig/hotspot/make/linux/makefiles/zeroshark.make
605045
+++ openjdk/hotspot/make/linux/makefiles/zeroshark.make
605045
@@ -1,5 +1,5 @@
605045
 #
605045
-# Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
605045
+# Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
605045
 # Copyright 2007, 2008 Red Hat, Inc.
605045
 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
605045
 #
605045
@@ -29,11 +29,6 @@
605045
 ifeq ($(USE_CLANG), true)
605045
   WARNING_FLAGS += -Wno-undef
605045
 endif
605045
-# Suppress some warning flags that are normally turned on for hotspot,
605045
-# because some of the zero code has not been updated accordingly.
605045
-WARNING_FLAGS += -Wno-return-type \
605045
-  -Wno-format-nonliteral -Wno-format-security \
605045
-  -Wno-maybe-uninitialized
605045
 
605045
 # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
605045
 OPT_CFLAGS/sharedRuntimeTrig.o = $(OPT_CFLAGS/NOOPT)
605045
diff --git openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
605045
--- openjdk.orig/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
605045
+++ openjdk/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp
605045
@@ -100,7 +100,7 @@
605045
     case T_DOUBLE:
605045
     case T_VOID:
605045
       return result;
605045
-    default  : ShouldNotReachHere();
605045
+    default  : ShouldNotReachHere(); return NULL_WORD;
605045
   }
605045
 }
605045
 
605045
diff --git openjdk.orig/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp openjdk/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
605045
--- openjdk.orig/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
605045
+++ openjdk/hotspot/src/cpu/zero/vm/interpreterRT_zero.cpp
605045
@@ -1,5 +1,5 @@
605045
 /*
605045
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
605045
+ * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
605045
  * Copyright 2007, 2008, 2010 Red Hat, Inc.
605045
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
605045
  *
605045
@@ -62,7 +62,7 @@
605045
 }
605045
 
605045
 void InterpreterRuntime::SignatureHandlerGeneratorBase::push(BasicType type) {
605045
-  ffi_type *ftype;
605045
+  ffi_type *ftype = NULL;
605045
   switch (type) {
605045
   case T_VOID:
605045
     ftype = &ffi_type_void;
605045
diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
605045
--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
605045
+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp
605045
@@ -1,6 +1,6 @@
605045
 /*
605045
  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
605045
- * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
605045
+ * Copyright 2016 Red Hat, Inc.
605045
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
605045
  *
605045
  * This code is free software; you can redistribute it and/or modify it
605045
@@ -61,6 +61,7 @@
605045
 
605045
 frame os::get_sender_for_C_frame(frame* fr) {
605045
   ShouldNotCallThis();
605045
+  return frame(NULL, NULL); // silence compile warning.
605045
 }
605045
 
605045
 frame os::current_frame() {
605045
@@ -98,16 +99,19 @@
605045
 
605045
 address os::Linux::ucontext_get_pc(ucontext_t* uc) {
605045
   ShouldNotCallThis();
605045
+  return NULL; // silence compile warnings
605045
 }
605045
 
605045
 ExtendedPC os::fetch_frame_from_context(void* ucVoid,
605045
                                         intptr_t** ret_sp,
605045
                                         intptr_t** ret_fp) {
605045
   ShouldNotCallThis();
605045
+  return NULL; // silence compile warnings
605045
 }
605045
 
605045
 frame os::fetch_frame_from_context(void* ucVoid) {
605045
   ShouldNotCallThis();
605045
+  return frame(NULL, NULL); // silence compile warnings
605045
 }
605045
 
605045
 extern "C" JNIEXPORT int
605045
@@ -247,11 +251,16 @@
605045
   }
605045
 #endif // !PRODUCT
605045
 
605045
-  const char *fmt = "caught unhandled signal %d";
605045
   char buf[64];
605045
 
605045
-  sprintf(buf, fmt, sig);
605045
+  sprintf(buf, "caught unhandled signal %d", sig);
605045
+
605045
+// Silence -Wformat-security warning for fatal()
605045
+PRAGMA_DIAG_PUSH
605045
+PRAGMA_FORMAT_NONLITERAL_IGNORED
605045
   fatal(buf);
605045
+PRAGMA_DIAG_POP
605045
+  return true; // silence compiler warnings
605045
 }
605045
 
605045
 void os::Linux::init_thread_fpu_state(void) {
605045
@@ -260,6 +269,7 @@
605045
 
605045
 int os::Linux::get_fpu_control_word() {
605045
   ShouldNotCallThis();
605045
+  return -1; // silence compile warnings
605045
 }
605045
 
605045
 void os::Linux::set_fpu_control_word(int fpu) {
605045
@@ -408,6 +418,7 @@
605045
 
605045
 extern "C" {
605045
   int SpinPause() {
605045
+      return -1; // silence compile warnings
605045
   }
605045
 
605045
 
605045
diff --git openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp openjdk/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
605045
--- openjdk.orig/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
605045
+++ openjdk/hotspot/src/os_cpu/linux_zero/vm/thread_linux_zero.hpp
605045
@@ -1,5 +1,5 @@
605045
 /*
605045
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
605045
+ * Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved.
605045
  * Copyright 2007, 2008, 2009, 2010 Red Hat, Inc.
605045
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
605045
  *
605045
@@ -110,6 +110,7 @@
605045
                                            void* ucontext,
605045
                                            bool isInJava) {
605045
     ShouldNotCallThis();
605045
+    return false; // silence compile warning
605045
   }
605045
 
605045
   // These routines are only used on cpu architectures that