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

gcc 7.2.1 compiler warning in libdt_socket

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 10
    • Fix Version/s: 11
    • Component/s: core-svc
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      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

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

                Dates

                • Created:
                  Updated:
                  Resolved: