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

Constant AO_UNUSED_MBZ uses left shift of negative value

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 12
    • Component/s: core-libs
    • Labels:
      None
    • Resolved In Build:
      b15
    • CPU:
      generic
    • OS:
      generic

      Description

      The constant AO_UNUSED_MBZ in jdk.pack's constants.h is initialized using the expression (-1 << 13). In C89/C++98 the semantics of left shifts of negative values are not described. C99/C++11 clarified that this is undefined behavior.

      gcc -Wshift-negative-value warns about this. That warning is implicitly enabled by -Wextra when requesting builds using recent versions of the language standards.

      Note that the jdk.pack module is deprecated.

        Attachments

          Activity

            People

            • Assignee:
              kbarrett Kim Barrett
              Reporter:
              kbarrett Kim Barrett
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: