Blame SOURCES/jdk8143245-pr3548-zero_build_requires_disabled_warnings.patch

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