8051989: Unportable format string argument mismatch in jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp
authorkizune
Tue, 09 Sep 2014 17:20:26 +0400
changeset 26457 1c341086cc51
parent 26456 24d86ff9740f
child 26458 d6a5aed9204b
8051989: Unportable format string argument mismatch in jdk/src/share/native/com/sun/java/util/jar/pack/unpack.cpp Reviewed-by: ksrini
jdk/src/jdk.runtime/share/native/common-unpack/unpack.cpp
--- a/jdk/src/jdk.runtime/share/native/common-unpack/unpack.cpp	Tue Sep 09 12:04:31 2014 +0200
+++ b/jdk/src/jdk.runtime/share/native/common-unpack/unpack.cpp	Tue Sep 09 17:20:26 2014 +0400
@@ -32,9 +32,12 @@
  *    the printf format %ld is correct and use of %lld will cause warning
  *    errors from some compilers (gcc/g++).
  * _LP64 can be explicitly set (used on Linux).
+ * Should be checking for the Visual C++ since the _LP64 is set on the 64-bit
+ * systems but the correct format prefix for 64-bit integers is ll.
  * Solaris compilers will define __sparcv9 or __x86_64 on 64bit compilations.
  */
-#if defined(_LP64) || defined(__sparcv9) || defined(__x86_64)
+#if !defined (_MSC_VER) && \
+    (defined(_LP64) || defined(__sparcv9) || defined(__x86_64))
   #define LONG_LONG_FORMAT "%ld"
   #define LONG_LONG_HEX_FORMAT "%lx"
 #else