src/hotspot/share/services/diagnosticArgument.cpp
changeset 58682 9f5b92d5a1b2
parent 58084 cddef3bde924
--- a/src/hotspot/share/services/diagnosticArgument.cpp	Thu Oct 17 22:41:36 2019 +0200
+++ b/src/hotspot/share/services/diagnosticArgument.cpp	Fri Oct 18 09:57:20 2019 +0900
@@ -151,7 +151,13 @@
       ResourceMark rm;
 
       char* buf = NEW_RESOURCE_ARRAY(char, len + 1);
+
+PRAGMA_DIAG_PUSH
+PRAGMA_STRINGOP_TRUNCATION_IGNORED
+      // This code can incorrectly cause a "stringop-truncation" warning with gcc
       strncpy(buf, str, len);
+PRAGMA_DIAG_POP
+
       buf[len] = '\0';
       Exceptions::fthrow(THREAD_AND_LOCATION, vmSymbols::java_lang_IllegalArgumentException(),
         "Boolean parsing error in command argument '%s'. Could not parse: %s.\n", _name, buf);