Blame jdk8143245-pr3548-zero_build_requires_disabled_warnings.patch

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