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

Accessibility: Conversion from string literal loses const qualifier

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • 19
    • client-libs

      Compiling OpenJDK with Visual Studio 2019 and with -Zc:strictStrings flag enabled produces a few compilation errors.

      String literal to non-const pointer conversion, when used incorrectly, may result in runtime errors. Using Zc:strictStrings forces users to either use const pointers, or use explicit conversion, which is easier to spot and review.

      GCC and Clang already warn on this conversion in all C++ code.

            djelinski Daniel Jelinski
            djelinski Daniel Jelinski
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: