8184309: Buld warnings from GCC 7.1 on Fedora 26
authorysuenaga
Mon, 17 Jul 2017 14:10:01 +0300
changeset 46672 dc24cb5e50a1
parent 46669 05296a16012a
child 46673 bab8454fdbed
8184309: Buld warnings from GCC 7.1 on Fedora 26 Reviewed-by: kbarrett, vlivanov
hotspot/src/share/vm/code/dependencies.cpp
hotspot/src/share/vm/logging/logFileOutput.cpp
hotspot/src/share/vm/logging/logFileOutput.hpp
--- a/hotspot/src/share/vm/code/dependencies.cpp	Mon Jul 17 10:32:36 2017 +0200
+++ b/hotspot/src/share/vm/code/dependencies.cpp	Mon Jul 17 14:10:01 2017 +0300
@@ -742,7 +742,7 @@
         xtty->object("x", arg.metadata_value());
       }
     } else {
-      char xn[10]; sprintf(xn, "x%d", j);
+      char xn[12]; sprintf(xn, "x%d", j);
       if (arg.is_oop()) {
         xtty->object(xn, Handle(thread, arg.oop_value()));
       } else {
--- a/hotspot/src/share/vm/logging/logFileOutput.cpp	Mon Jul 17 10:32:36 2017 +0200
+++ b/hotspot/src/share/vm/logging/logFileOutput.cpp	Mon Jul 17 14:10:01 2017 +0300
@@ -32,13 +32,13 @@
 #include "utilities/globalDefinitions.hpp"
 #include "utilities/defaultStream.hpp"
 
-const char* LogFileOutput::Prefix = "file=";
-const char* LogFileOutput::FileOpenMode = "a";
-const char* LogFileOutput::PidFilenamePlaceholder = "%p";
-const char* LogFileOutput::TimestampFilenamePlaceholder = "%t";
-const char* LogFileOutput::TimestampFormat = "%Y-%m-%d_%H-%M-%S";
-const char* LogFileOutput::FileSizeOptionKey = "filesize";
-const char* LogFileOutput::FileCountOptionKey = "filecount";
+const char* const LogFileOutput::Prefix = "file=";
+const char* const LogFileOutput::FileOpenMode = "a";
+const char* const LogFileOutput::PidFilenamePlaceholder = "%p";
+const char* const LogFileOutput::TimestampFilenamePlaceholder = "%t";
+const char* const LogFileOutput::TimestampFormat = "%Y-%m-%d_%H-%M-%S";
+const char* const LogFileOutput::FileSizeOptionKey = "filesize";
+const char* const LogFileOutput::FileCountOptionKey = "filecount";
 char        LogFileOutput::_pid_str[PidBufferSize];
 char        LogFileOutput::_vm_start_time_str[StartTimeBufferSize];
 
--- a/hotspot/src/share/vm/logging/logFileOutput.hpp	Mon Jul 17 10:32:36 2017 +0200
+++ b/hotspot/src/share/vm/logging/logFileOutput.hpp	Mon Jul 17 14:10:01 2017 +0300
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
@@ -33,12 +33,12 @@
 // The log file output, with support for file rotation based on a target size.
 class LogFileOutput : public LogFileStreamOutput {
  private:
-  static const char*  FileOpenMode;
-  static const char*  FileCountOptionKey;
-  static const char*  FileSizeOptionKey;
-  static const char*  PidFilenamePlaceholder;
-  static const char*  TimestampFilenamePlaceholder;
-  static const char*  TimestampFormat;
+  static const char* const FileOpenMode;
+  static const char* const FileCountOptionKey;
+  static const char* const FileSizeOptionKey;
+  static const char* const PidFilenamePlaceholder;
+  static const char* const TimestampFilenamePlaceholder;
+  static const char* const TimestampFormat;
   static const size_t DefaultFileCount = 5;
   static const size_t DefaultFileSize = 20 * M;
   static const size_t StartTimeBufferSize = 20;
@@ -91,7 +91,7 @@
     return _name;
   }
 
-  static const char* Prefix;
+  static const char* const Prefix;
   static void set_file_name_parameters(jlong start_time);
 };