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

gcc 7.2.1 compiler warning in libdt_socket

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 11
    • 10
    • core-svc
    • b03

    Description

      <jdk-dev>/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c: In function ‘mask_s2u’:
      <jdk-dev>/jdk/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c:389:22: warning: left shift of negative value [-Wshift-negative-value]
           *mask = htonl(-1 << (32 - m));
                            ^
      Suggested fix:

      diff --git a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c
      --- a/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c
      +++ b/src/jdk.jdwp.agent/share/native/libdt_socket/socketTransport.c
      @@ -386,7 +386,7 @@
              return instr;
           }
       
      - *mask = htonl(-1 << (32 - m));
      + *mask = htonl((uint32_t)(~0) << (32 - m));
           return s;
       }
       

      Attachments

        Issue Links

          Activity

            People

              cjplummer Chris Plummer
              cjplummer Chris Plummer
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: