Blame jdk8143245-pr3548-zero_build_requires_disabled_warnings.patch

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