Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8160294

Some client libraries cannot be built with GCC 6

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: client-libs
    • Labels:
      None
    • Subcomponent:
      2d
    • Resolved In Build:
      b127

      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.

        Issue Links

          Activity

          Show
          ysuenaga Yasumasa Suenaga added a comment - webrev:    http://cr.openjdk.java.net/~ysuenaga/JDK-8160294/webrev.00/
          Hide
          ysuenaga Yasumasa Suenaga added a comment -
          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
          Show
          ysuenaga Yasumasa Suenaga added a comment - 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
          Hide
          ysuenaga Yasumasa Suenaga added a comment -
          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
          Show
          ysuenaga Yasumasa Suenaga added a comment - 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
          Hide
          ysuenaga Yasumasa Suenaga added a comment -
          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
          Show
          ysuenaga Yasumasa Suenaga added a comment - 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
          Hide
          ysuenaga Yasumasa Suenaga added a comment -
          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
          Show
          ysuenaga Yasumasa Suenaga added a comment - 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
          Hide
          ysuenaga Yasumasa Suenaga added a comment -
          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
          Show
          ysuenaga Yasumasa Suenaga added a comment - 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
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/38185af88d22
          User: ysuenaga
          Date: 2016-07-02 13:29:03 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/client/jdk/rev/38185af88d22 User: ysuenaga Date: 2016-07-02 13:29:03 +0000
          Hide
          hgupdate HG Updates added a comment -
          URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/38185af88d22
          User: amurillo
          Date: 2016-07-13 03:50:56 +0000
          Show
          hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/38185af88d22 User: amurillo Date: 2016-07-13 03:50:56 +0000

            People

            • Assignee:
              ysuenaga Yasumasa Suenaga
              Reporter:
              ysuenaga Yasumasa Suenaga
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: