From c2f77856514ef06693d5e2a13da5c70e6ca42f7b Mon Sep 17 00:00:00 2001 From: Yasumasa Suenaga Date: Sat, 2 Jul 2016 22:28:40 +0900 Subject: [PATCH] 8160294: Some client libraries cannot be built with GCC 6 Reviewed-by: prr, flar, erikj, kbarrett --- jdk/make/lib/Awt2dLibraries.gmk | 6 +++--- .../share/native/libawt/java2d/loops/AlphaMath.c | 4 ++-- .../share/native/libfontmanager/layout/SunLayoutEngine.cpp | 3 ++- .../share/native/libsplashscreen/splashscreen_jpeg.c | 3 ++- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/jdk/make/lib/Awt2dLibraries.gmk b/jdk/make/lib/Awt2dLibraries.gmk index c8fd1459afe..25778fa52ac 100644 --- a/jdk/make/lib/Awt2dLibraries.gmk +++ b/jdk/make/lib/Awt2dLibraries.gmk @@ -426,7 +426,7 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBLCMS, \ $(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 @@ $(eval $(call SetupNativeCompilation,BUILD_LIBJAVAJPEG, \ 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 @@ ifndef BUILD_HEADLESS_ONLY 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, \ diff --git a/jdk/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c b/jdk/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c index 12cde0f3b10..83e8d1ede34 100644 --- a/jdk/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c +++ b/jdk/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c @@ -34,8 +34,8 @@ void initAlphaTables() 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; diff --git a/jdk/src/java.desktop/share/native/libfontmanager/layout/SunLayoutEngine.cpp b/jdk/src/java.desktop/share/native/libfontmanager/layout/SunLayoutEngine.cpp index a9aea06683e..c5284d7ec44 100644 --- a/jdk/src/java.desktop/share/native/libfontmanager/layout/SunLayoutEngine.cpp +++ b/jdk/src/java.desktop/share/native/libfontmanager/layout/SunLayoutEngine.cpp @@ -151,7 +151,8 @@ JNIEXPORT void JNICALL Java_sun_font_SunLayoutEngine_nativeLayout 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]; diff --git a/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_jpeg.c b/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_jpeg.c index e773fd4ee39..ba91abbed46 100644 --- a/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_jpeg.c +++ b/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_jpeg.c @@ -237,13 +237,14 @@ int 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);