changeset 50469:1476689320e0

8196990: Resolve disabled warnings for libjli Summary: initialized uninitialzed data to avoid maybe-uninitialized warnings from gcc Reviewed-by: jlaskey
author sdama
date Fri, 08 Jun 2018 21:06:54 +0530
parents 4a5fd709e286
children f3aac763a315
files make/lib/CoreLibraries.gmk src/java.base/share/native/libjli/args.c
diffstat 2 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/make/lib/CoreLibraries.gmk	Fri Jun 08 16:33:40 2018 +0100
+++ b/make/lib/CoreLibraries.gmk	Fri Jun 08 21:06:54 2018 +0530
@@ -298,7 +298,6 @@
     EXTRA_FILES := $(LIBJLI_EXTRA_FILES), \
     OPTIMIZATION := HIGH, \
     CFLAGS := $(LIBJLI_CFLAGS), \
-    DISABLED_WARNINGS_gcc := maybe-uninitialized, \
     DISABLED_WARNINGS_solstudio := \
         E_ASM_DISABLES_OPTIMIZATION \
         E_STATEMENT_NOT_REACHED, \
--- a/src/java.base/share/native/libjli/args.c	Fri Jun 08 16:33:40 2018 +0100
+++ b/src/java.base/share/native/libjli/args.c	Fri Jun 08 21:06:54 2018 +0530
@@ -305,6 +305,8 @@
 
     ctx.state = FIND_NEXT;
     ctx.parts = JLI_List_new(4);
+    // initialize to avoid -Werror=maybe-uninitialized issues from gcc 7.3 onwards.
+    ctx.quote_char = '"';
 
     /* arbitrarily pick 8, seems to be a reasonable number of arguments */
     rv = JLI_List_new(8);