From a9798569ccc31f96a601315b8350a67b4826fab7 Mon Sep 17 00:00:00 2001 From: Jeevan Chalke Date: Thu, 22 Aug 2024 16:19:25 +0530 Subject: [PATCH] Fix some compiler warnings seen with the newer gcc version MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reported on GitHub through issue #75 by Devrim Gündüz (devrimgunduz). FDW-702, Sravan Velagandula. --- hdfs_query.c | 4 ++-- libhive/jdbc/hiveclient.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hdfs_query.c b/hdfs_query.c index dd528b3..2d820b5 100644 --- a/hdfs_query.c +++ b/hdfs_query.c @@ -72,7 +72,7 @@ hdfs_find_row_count(char *src) strncpy(row_count, pos + strlen(statistics_str), 50); /* Make sure that the string is null terminated */ - row_count[51] = '\0'; + row_count[50] = '\0'; return strtod(row_count, NULL); } @@ -88,7 +88,7 @@ hdfs_rowcount(int con_index, hdfs_opt *opt, PlannerInfo *root, { bool is_null; StringInfoData sql; - double rc; + double rc = 0; initStringInfo(&sql); hdfs_deparse_explain(opt, &sql); diff --git a/libhive/jdbc/hiveclient.cpp b/libhive/jdbc/hiveclient.cpp index 147fcdc..6d1746d 100644 --- a/libhive/jdbc/hiveclient.cpp +++ b/libhive/jdbc/hiveclient.cpp @@ -98,7 +98,7 @@ int Initialize() { return -1; } - delete libjvm; + delete[] libjvm; _JNI_CreateJavaVM = (_JNI_CreateJavaVM_PTR)dlsym(hdfs_dll_handle, "JNI_CreateJavaVM"); @@ -118,7 +118,7 @@ int Initialize() rc = _JNI_CreateJavaVM(&g_jvm, &g_jni, &vm_args); delete[] options[0].optionString; - delete options; + delete[] options; if (rc != JNI_OK) { return(-1);