Blame SOURCES/jdk8143245-pr3548-zero_build_requires_disabled_warnings.patch

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