Blame SOURCES/jdk8143245-pr3548-zero_build_requires_disabled_warnings.patch

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