Constant AO_UNUSED_MBZ uses left shift of negative value

XMLWordPrintable

    • 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.

              Assignee:
              Kim Barrett
              Reporter:
              Kim Barrett
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: