Blame SOURCES/jdk8143245-pr3548-zero_build_requires_disabled_warnings.patch

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