JDK-8160294 : Some client libraries cannot be built with GCC 6
  • Type: Bug
  • Component: client-libs
  • Sub-Component: 2d
  • Affected Version: 9
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2016-06-25
  • Updated: 2016-07-14
  • Resolved: 2016-07-02
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b127Fixed
Related Reports
Relates :  
Relates :  
Description
http://mail.openjdk.java.net/pipermail/jdk9-dev/2016-June/004494.html

Some client libraries could not be built with misleading-indentation
and shift-negative-value warining (error) on GCC 6.1.1 .

So I think we have to fix new warnings.

However, some libraries (LCMS, JPEG library, and fdlibm) are imported
from another open source project. So we should avoid compile error
with suppressing them.
Comments
Error #5: clobbered variable at splashscreen_jpeg.c: ``` /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_jpeg.c: In function 'SplashDecodeJpegStream': /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libsplashscreen/splashscreen_jpeg.c:240:9: error: variable 'success' might be clobbered by 'longjmp' or 'vfork' [-Werror=clobbered] int success = 0; ^~~~~~~ cc1: all warnings being treated as errors
26-06-2016

Error #4: misleading indentation at SunLayoutEngine.cpp `` /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libfontmanager/layout/SunLayoutEngine.cpp:154:3: error: this 'if' clause does not guard... [-Werror=misleading-indentation] if (min < 0) min = 0; if (max < min) max = min; /* defensive coding */ ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libfontmanager/layout/SunLayoutEngine.cpp:154:25: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'if' if (min < 0) min = 0; if (max < min) max = min; /* defensive coding */ ^~ cc1plus: all warnings being treated as errors
26-06-2016

Error #3: left shift of negative value at libjavajpeg ``` /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:458:13: error: left shift of negative value [-Werror=shift-negative-value] { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:458:28: error: left shift of negative value [-Werror=shift-negative-value] { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:458:43: error: left shift of negative value [-Werror=shift-negative-value] { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:458:58: error: left shift of negative value [-Werror=shift-negative-value] { 0, ((-1)<<1) + 1, ((-1)<<2) + 1, ((-1)<<3) + 1, ((-1)<<4) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:459:10: error: left shift of negative value [-Werror=shift-negative-value] ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:459:25: error: left shift of negative value [-Werror=shift-negative-value] ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:459:40: error: left shift of negative value [-Werror=shift-negative-value] ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:459:55: error: left shift of negative value [-Werror=shift-negative-value] ((-1)<<5) + 1, ((-1)<<6) + 1, ((-1)<<7) + 1, ((-1)<<8) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:460:10: error: left shift of negative value [-Werror=shift-negative-value] ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:460:25: error: left shift of negative value [-Werror=shift-negative-value] ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:460:41: error: left shift of negative value [-Werror=shift-negative-value] ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:460:57: error: left shift of negative value [-Werror=shift-negative-value] ((-1)<<9) + 1, ((-1)<<10) + 1, ((-1)<<11) + 1, ((-1)<<12) + 1, ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:461:10: error: left shift of negative value [-Werror=shift-negative-value] ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:461:26: error: left shift of negative value [-Werror=shift-negative-value] ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; ^~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libjavajpeg/jdhuff.c:461:42: error: left shift of negative value [-Werror=shift-negative-value] ((-1)<<13) + 1, ((-1)<<14) + 1, ((-1)<<15) + 1 }; ^~ cc1: all warnings being treated as errors
26-06-2016

Error #2: misleading indentation at LCMS ``` /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/liblcms/cmscgats.c: In function 'ReadReal': /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/liblcms/cmscgats.c:606:9: error: this 'else' clause does not guard... [-Werror=misleading-indentation] else ^~~~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/liblcms/cmscgats.c:613:13: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else' e = 0; ^ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/liblcms/cmscgats.c: In function 'ParseFloatNumber': /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/liblcms/cmscgats.c:683:9: error: this 'else' clause does not guard... [-Werror=misleading-indentation] else ^~~~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/liblcms/cmscgats.c:690:13: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the 'else' e = 0; ^ cc1: all warnings being treated as errors
26-06-2016

Error #1: undefined behavior at AlphaMath.c ``` /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c: In function 'initAlphaTables': /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c:41:17: error: iteration 127 invokes undefined behavior [-Werror=aggressive-loop-optimizations] val += inc; ~~~~^~~~~~ /home/ysuenaga/OpenJDK/client/jdk/src/java.desktop/share/native/libawt/java2d/loops/AlphaMath.c:36:5: note: within this loop for (i = 1; i < 256; i++) { /* SCALE == (1 << 24) */ ^~~ cc1: all warnings being treated as errors
26-06-2016

webrev: http://cr.openjdk.java.net/~ysuenaga/JDK-8160294/webrev.00/
26-06-2016