Blame SOURCES/jdk8143245-pr3548-zero_build_requires_disabled_warnings.patch

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