8160294: Some client libraries cannot be built with GCC 6
authorysuenaga
Sat, 02 Jul 2016 22:28:40 +0900
changeset 39550 8d587cab45d2
parent 39549 26cd79781f7a
child 39551 7eaf6bb9bc67
8160294: Some client libraries cannot be built with GCC 6 Reviewed-by: prr, flar, erikj, kbarrett
jdk/make/lib/Awt2dLibraries.gmk
jdk/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c
jdk/src/java.desktop/share/native/libfontmanager/layout/SunLayoutEngine.cpp
jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_jpeg.c
--- a/jdk/make/lib/Awt2dLibraries.gmk	Fri Jul 01 14:29:36 2016 -0700
+++ b/jdk/make/lib/Awt2dLibraries.gmk	Sat Jul 02 22:28:40 2016 +0900
@@ -426,7 +426,7 @@
         $(LCMS_CFLAGS), \
     CFLAGS_solaris := -xc99=no_lib, \
     CFLAGS_windows := -DCMS_IS_WINDOWS_, \
-    DISABLED_WARNINGS_gcc := format-nonliteral type-limits, \
+    DISABLED_WARNINGS_gcc := format-nonliteral type-limits misleading-indentation, \
     DISABLED_WARNINGS_clang := tautological-compare, \
     DISABLED_WARNINGS_solstudio := E_STATEMENT_NOT_REACHED, \
     MAPFILE := $(JDK_TOPDIR)/make/mapfiles/liblcms/mapfile-vers, \
@@ -507,7 +507,7 @@
     CFLAGS := $(CFLAGS_JDKLIB) $(BUILD_LIBJAVAJPEG_HEADERS) \
         $(LIBJAVA_HEADER_FLAGS) \
         -I$(SUPPORT_OUTPUTDIR)/headers/java.desktop, \
-    DISABLED_WARNINGS_gcc := clobbered parentheses array-bounds, \
+    DISABLED_WARNINGS_gcc := clobbered parentheses array-bounds shift-negative-value, \
     DISABLED_WARNINGS_clang := logical-op-parentheses, \
     DISABLED_WARNINGS_microsoft := 4267, \
     MAPFILE := $(BUILD_LIBJAVAJPEG_MAPFILE), \
@@ -943,7 +943,7 @@
       OPTIMIZATION := LOW, \
       CFLAGS := $(LIBSPLASHSCREEN_CFLAGS) $(CFLAGS_JDKLIB) \
                 $(GIFLIB_CFLAGS) $(LIBJPEG_CFLAGS) $(PNG_CFLAGS), \
-      DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result maybe-uninitialized, \
+      DISABLED_WARNINGS_gcc := sign-compare type-limits unused-result maybe-uninitialized shift-negative-value, \
       DISABLED_WARNINGS_clang := incompatible-pointer-types, \
       DISABLED_WARNINGS_solstudio := E_NEWLINE_NOT_LAST E_DECLARATION_IN_CODE \
           E_STATEMENT_NOT_REACHED, \
--- a/jdk/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c	Fri Jul 01 14:29:36 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c	Sat Jul 02 22:28:40 2016 +0900
@@ -34,8 +34,8 @@
     unsigned int j;
 
     for (i = 1; i < 256; i++) {                 /* SCALE == (1 << 24) */
-        int inc = (i << 16) + (i<<8) + i;       /* approx. SCALE * (i/255.0) */
-        int val = inc + (1 << 23);              /* inc + SCALE*0.5 */
+        unsigned int inc = (i << 16) + (i<<8) + i;       /* approx. SCALE * (i/255.0) */
+        unsigned int val = inc + (1 << 23);              /* inc + SCALE*0.5 */
         for (j = 1; j < 256; j++) {
             mul8table[i][j] = (val >> 24);      /* val / SCALE */
             val += inc;
--- a/jdk/src/java.desktop/share/native/libfontmanager/layout/SunLayoutEngine.cpp	Fri Jul 01 14:29:36 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/SunLayoutEngine.cpp	Sat Jul 02 22:28:40 2016 +0900
@@ -151,7 +151,8 @@
     return;
   }
 
-  if (min < 0) min = 0; if (max < min) max = min; /* defensive coding */
+  if (min < 0) min = 0;
+  if (max < min) max = min; /* defensive coding */
   // have to copy, yuck, since code does upcalls now.  this will be soooo slow
   jint len = max - min;
   jchar buffer[256];
--- a/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_jpeg.c	Fri Jul 01 14:29:36 2016 -0700
+++ b/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_jpeg.c	Sat Jul 02 22:28:40 2016 +0900
@@ -237,13 +237,14 @@
 SplashDecodeJpegStream(Splash * splash, SplashStream * stream)
 {
     struct jpeg_decompress_struct cinfo;
-    int success = 0;
+    int success;
     struct my_error_mgr jerr;
 
     cinfo.err = jpeg_std_error(&jerr.pub);
     jerr.pub.error_exit = my_error_exit;
 
     if (setjmp(jerr.setjmp_buffer)) {
+        success = 0;
         goto done;
     }
     jpeg_create_decompress(&cinfo);