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

Make mlvmJvmtiUtils strncpy uses GCC 8.x friendly

    Details

    • Type: Enhancement
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 13
    • Fix Version/s: 13
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b09

      Description

      GCC 8.2 is producing a warning for mlvmJvmtiUtils.cpp:

      In file included from test/hotspot/jtreg/vmTestbase/vm/mlvm/indy/func/jvmti/share/libIndyRedefineClass.cpp:31:
      test/hotspot/jtreg/vmTestbase/vm/mlvm/share/mlvmJvmtiUtils.cpp: In function 'MethodName* getMethodName(jvmtiEnv*, jmethodID)':
      test/hotspot/jtreg/vmTestbase/vm/mlvm/share/mlvmJvmtiUtils.cpp:80:12: error: 'char* strncpy(char*, const char*, size_t)' specified bound 256 equals destination size [-Werror=stringop-truncation]
           strncpy(mn->methodName, szName, sizeof(mn->methodName));
           ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                mikael Mikael Vidstedt
                Reporter:
                mikael Mikael Vidstedt
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: