diff src/share/vm/utilities/ostream.cpp @ 17937:78bbf4d43a14

8037816: Fix for 8036122 breaks build with Xcode5/clang 8043029: Change 8037816 breaks HS build with older GCC versions which don't support diagnostic pragmas 8043164: Format warning in traceStream.hpp Summary: Backport of main fix + two corrections, enables clang compilation, turns on format attributes, corrects/mutes warnings Reviewed-by: kvn, coleenp, iveresov, twisti
author drchase
date Thu, 22 May 2014 15:52:41 -0400
parents f42c10a3d4b1
children 52b4284cb496 0982ec23da03 a4fdab16b621
line wrap: on
line diff
--- a/src/share/vm/utilities/ostream.cpp	Thu May 15 18:23:26 2014 -0400
+++ b/src/share/vm/utilities/ostream.cpp	Thu May 22 15:52:41 2014 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2014, 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
@@ -268,7 +268,7 @@
   size_t limit = (len + 16) / 16 * 16;
   for (size_t i = 0; i < limit; ++i) {
     if (i % 16 == 0) {
-      indent().print("%07x:", i);
+      indent().print(SIZE_FORMAT_HEX_W(07)":", i);
     }
     if (i % 2 == 0) {
       print(" ");
@@ -289,7 +289,7 @@
           }
         }
       }
-      print_cr("");
+      cr();
     }
   }
 }
@@ -606,7 +606,7 @@
 // memory usage and command line flags into header
 void gcLogFileStream::dump_loggc_header() {
   if (is_open()) {
-    print_cr(Abstract_VM_Version::internal_vm_info_string());
+    print_cr("%s", Abstract_VM_Version::internal_vm_info_string());
     os::print_memory_info(this);
     print("CommandLine flags: ");
     CommandLineFlags::printSetFlags(this);
@@ -687,7 +687,7 @@
     write(time_msg, strlen(time_msg));
 
     if (out != NULL) {
-      out->print(time_msg);
+      out->print("%s", time_msg);
     }
 
     dump_loggc_header();
@@ -720,7 +720,7 @@
     write(time_msg, strlen(time_msg));
 
     if (out != NULL) {
-      out->print(time_msg);
+      out->print("%s", time_msg);
     }
 
     fclose(_file);
@@ -765,7 +765,7 @@
     write(time_msg, strlen(time_msg));
 
     if (out != NULL) {
-      out->print(time_msg);
+      out->print("%s", time_msg);
     }
 
     dump_loggc_header();
@@ -845,7 +845,7 @@
     xs->head("hotspot_log version='%d %d'"
              " process='%d' time_ms='"INT64_FORMAT"'",
              LOG_MAJOR_VERSION, LOG_MINOR_VERSION,
-             os::current_process_id(), time_ms);
+             os::current_process_id(), (int64_t)time_ms);
     // Write VM version header immediately.
     xs->head("vm_version");
     xs->head("name"); xs->text("%s", VM_Version::vm_name()); xs->cr();