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

Make mlvmJvmtiUtils strncpy uses GCC 8.x friendly

    XMLWordPrintable

Details

    • Enhancement
    • Status: Resolved
    • P4
    • Resolution: Fixed
    • 13
    • 13
    • hotspot
    • 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

              mikael Mikael Vidstedt
              mikael Mikael Vidstedt
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: