Blame SOURCES/jdk8143245-pr3548-zero_build_requires_disabled_warnings.patch

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