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

Constant AO_UNUSED_MBZ uses left shift of negative value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 12
    • None
    • core-libs
    • None
    • b15
    • generic
    • generic

      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.

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

              Created:
              Updated:
              Resolved: