8080991: Compilation error with recent clang in java.base/share/native/launcher/main.c: error: comparison of array 'const_jargs' not equal to a null pointer is always true
authorksrini
Thu, 28 May 2015 14:54:58 -0700
changeset 30822 e26f66cc0f05
parent 30821 9bc6f2e9966b
child 30823 00438d7bb747
8080991: Compilation error with recent clang in java.base/share/native/launcher/main.c: error: comparison of array 'const_jargs' not equal to a null pointer is always true Reviewed-by: ksrini, ddehaven Contributed-by: staffan.larsen@oracle.com
jdk/src/java.base/share/native/launcher/defines.h
jdk/src/java.base/share/native/launcher/main.c
--- a/jdk/src/java.base/share/native/launcher/defines.h	Thu May 28 17:37:33 2015 -0400
+++ b/jdk/src/java.base/share/native/launcher/defines.h	Thu May 28 14:54:58 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2005, 2006, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2005, 2015, 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
@@ -46,6 +46,7 @@
 
 
 #ifdef JAVA_ARGS
+#define HAS_JAVA_ARGS JNI_TRUE
 static const char* const_progname = "java";
 static const char* const_jargs[] = JAVA_ARGS;
 /*
@@ -58,6 +59,7 @@
 #endif /* APP_CLASSPATH */
 static const char* const_appclasspath[] = APP_CLASSPATH;
 #else  /* !JAVA_ARGS */
+#define HAS_JAVA_ARGS JNI_FALSE
 #ifdef PROGNAME
 static const char* const_progname = PROGNAME;
 #else
--- a/jdk/src/java.base/share/native/launcher/main.c	Thu May 28 17:37:33 2015 -0400
+++ b/jdk/src/java.base/share/native/launcher/main.c	Thu May 28 14:54:58 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1995, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2015, 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
@@ -129,6 +129,6 @@
                    DOT_VERSION,
                    (const_progname != NULL) ? const_progname : *margv,
                    (const_launcher != NULL) ? const_launcher : *margv,
-                   (const_jargs != NULL) ? JNI_TRUE : JNI_FALSE,
+                   HAS_JAVA_ARGS,
                    const_cpwildcard, const_javaw, const_ergo_class);
 }