pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/lang/openjdk11 lang/openjdk11: add patch for -Wchar-su...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/fda03d3ac0d8
branches:  trunk
changeset: 425325:fda03d3ac0d8
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Mar 21 10:46:57 2020 +0000

description:
lang/openjdk11: add patch for -Wchar-subscripts

diffstat:

 lang/openjdk11/distinfo                                        |   3 +-
 lang/openjdk11/patches/patch-src_hotspot_share_libadt_dict.cpp |  29 ++++++++++
 2 files changed, 31 insertions(+), 1 deletions(-)

diffs (50 lines):

diff -r 242495d3c9b3 -r fda03d3ac0d8 lang/openjdk11/distinfo
--- a/lang/openjdk11/distinfo   Sat Mar 21 10:37:14 2020 +0000
+++ b/lang/openjdk11/distinfo   Sat Mar 21 10:46:57 2020 +0000
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.8 2020/02/11 02:30:42 ryoon Exp $
+$NetBSD: distinfo,v 1.9 2020/03/21 10:46:57 rillig Exp $
 
 SHA1 (bootstrap-jdk-1.11.0.5.8-netbsd-7-amd64-20190928.tar.xz) = d76599619b8bea879b8202b3efc38a82335d2e8c
 RMD160 (bootstrap-jdk-1.11.0.5.8-netbsd-7-amd64-20190928.tar.xz) = a1b998e4e7edfb73ec35b0cc94895d9af16a8cd8
@@ -25,6 +25,7 @@
 SHA1 (patch-src_hotspot_os_bsd_os__bsd.cpp) = 86d9772592524f4119b4cf99671ac4d1224a28da
 SHA1 (patch-src_hotspot_os_bsd_os__perf__bsd.cpp) = 7bb57f82f3a93adc1970ed4215148fc02ecbcd5a
 SHA1 (patch-src_hotspot_os_posix_os__posix.cpp) = e70e8c1e59f0be184a7a1d6e9d11ac7b934ce4b2
+SHA1 (patch-src_hotspot_share_libadt_dict.cpp) = ad7ee25e66232b07db6abe7b13f9d6ed05a61202
 SHA1 (patch-src_java.base_bsd_native_libjava_ProcessHandleImpl__bsd.c) = fbc0aa6656292535fb38344fee7178b6f625f58a
 SHA1 (patch-src_java.base_unix_native_libjava_ProcessHandleImpl__unix.c) = 39c7afb3c36fa9557d2a660c4b4068b5684c552f
 SHA1 (patch-src_java.base_unix_native_libjava_ProcessHandleImpl__unix.h) = 121357cb76b4a96c06cc2bf670579e0b27f66fc1
diff -r 242495d3c9b3 -r fda03d3ac0d8 lang/openjdk11/patches/patch-src_hotspot_share_libadt_dict.cpp
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/lang/openjdk11/patches/patch-src_hotspot_share_libadt_dict.cpp    Sat Mar 21 10:46:57 2020 +0000
@@ -0,0 +1,29 @@
+$NetBSD: patch-src_hotspot_share_libadt_dict.cpp,v 1.1 2020/03/21 10:46:57 rillig Exp $
+
+Fix for -Werror=char-subscripts:
+
+> dict.cpp:15:28: warning: array subscript has type â??charâ?? [-Wchar-subscripts]
+>      sum += c + (c<<shft[k++]);  // Universal hash function
+>                             ^
+> dict.cpp:17:27: warning: array subscript has type â??charâ?? [-Wchar-subscripts]
+>    return (int)((sum+xsum[k]) >> 1); // Hash key, un-modulo'd table size
+
+The variable k only ever gets values between 0 and MAXID - 1, which is
+20. Therefore changing the type doesn't affect the result of the
+function. At optimization levels > 0, GCC 5.5.0 compiles to the same
+code, no matter whether the variable type is signed char or unsigned int.
+
+https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94247
+
+--- src/hotspot/share/libadt/dict.cpp.orig     2020-01-15 18:29:57.000000000 +0000
++++ src/hotspot/share/libadt/dict.cpp
+@@ -305,7 +305,8 @@ void Dict::print() {
+ // limited to MAXID characters in length.  Experimental evidence on 150K of
+ // C text shows excellent spreading of values for any size hash table.
+ int hashstr(const void *t) {
+-  register char c, k = 0;
++  register char c = 0;
++  register unsigned char k = 0;
+   register int32_t sum = 0;
+   register const char *s = (const char *)t;
+ 



Home | Main Index | Thread Index | Old Index