File mysql-workbench-warnings-fix.patch of Package mysql-workbench

diff -uNr mysql-workbench-community-8.0.15-org/backend/wbpublic/grt/spatial_handler.cpp mysql-workbench-community-8.0.15-src/backend/wbpublic/grt/spatial_handler.cpp
--- mysql-workbench-community-8.0.15-org/backend/wbpublic/grt/spatial_handler.cpp	2019-01-30 15:32:36.000000000 +0200
+++ mysql-workbench-community-8.0.15-src/backend/wbpublic/grt/spatial_handler.cpp	2019-02-16 13:56:53.711465800 +0200
@@ -86,7 +86,7 @@
     return "";
   }
   OGRSpatialReference srs;
-  char *_wkt = (char *)const_cast<char *>(&(*(wkt.begin())));
+  const char *_wkt = wkt.c_str();
   OGRErr err = srs.importFromWkt(&_wkt);
   if (err != OGRERR_NONE) {
     logError("ImportWKT Error: %s", stringFromErrorCode(err).c_str());
@@ -275,7 +275,7 @@
   CPLSetErrorHandler(&ogr_error_handler);
   OGRRegisterAll();
 
-  char *m_wkt = const_cast<char *>(
+  const char *m_wkt = (
     "PROJCS[\"World_Mercator\", "
     "GEOGCS[\"GCS_WGS_1984\", "
     "DATUM[\"WGS_1984\", "
@@ -291,7 +291,7 @@
     "AUTHORITY[\"EPSG\",\"54004\"]]");
   _mercator_srs.importFromWkt(&m_wkt);
 
-  char *e_wkt = const_cast<char *>(
+  const char *e_wkt = (
     "PROJCS[\"World_Equidistant_Cylindrical\","
     "GEOGCS[\"GCS_WGS_1984\","
     "DATUM[\"WGS_1984\","
@@ -307,7 +307,7 @@
     "AUTHORITY[\"EPSG\",\"54002\"]]");
   _equirectangular_srs.importFromWkt(&e_wkt);
 
-  char *r_wkt = const_cast<char *>(
+  const char *r_wkt = (
     "PROJCS[\"World_Robinson\","
     "GEOGCS[\"GCS_WGS_1984\","
     "DATUM[\"WGS_1984\","
@@ -322,7 +322,7 @@
     "AUTHORITY[\"EPSG\",\"54030\"]]");
   _robinson_srs.importFromWkt(&r_wkt);
 
-  char *g_wkt = const_cast<char *>(
+  const char *g_wkt = (
     "GEOGCS[\"WGS 84\", "
     "DATUM[\"WGS_1984\", "
     "SPHEROID[\"WGS 84\",6378137,298.257223563, "
@@ -335,7 +335,7 @@
     "AUTHORITY[\"EPSG\",\"4326\"]]");
   _geodetic_srs.importFromWkt(&g_wkt);
 
-  char *b_wkt = const_cast<char *>(
+  const char *b_wkt = (
     "PROJCS[\"World_Bonne\", "
     "GEOGCS[\"GCS_WGS_1984\", "
     "DATUM[\"WGS_1984\", "
@@ -509,7 +509,7 @@
 }
 
 int spatial::Importer::import_from_wkt(std::string data) {
-  char *d = &(*data.begin());
+  const char *d = data.c_str();
   OGRErr ret_val = OGRGeometryFactory::createFromWkt(&d, NULL, &_geometry);
 
   if (_geometry)
diff -uNr mysql-workbench-community-8.0.15-org/library/base/util_functions.cpp mysql-workbench-community-8.0.15-src/library/base/util_functions.cpp
--- mysql-workbench-community-8.0.15-org/library/base/util_functions.cpp	2019-01-30 15:32:36.000000000 +0200
+++ mysql-workbench-community-8.0.15-src/library/base/util_functions.cpp	2019-02-16 13:56:53.711465800 +0200
@@ -127,9 +127,9 @@
   while ((ptr = strstr(bptr, search)) != NULL) {
     __sappend(&res, &ressize, &reslen, bptr, (int)(ptr - bptr));
     bptr = ptr + searchlen;
-    __sappend(&res, &ressize, &reslen, replace, replsize);
+    __sappend(&res, &ressize, &reslen, replace, 1 + replsize);
   }
-  __sappend(&res, &ressize, &reslen, bptr, (int)strlen(bptr));
+  __sappend(&res, &ressize, &reslen, bptr, 1 + (int)strlen(bptr));
 
   return res;
 }
diff -uNr mysql-workbench-community-8.0.15-org/library/forms/swig/CMakeLists.txt mysql-workbench-community-8.0.15-src/library/forms/swig/CMakeLists.txt
--- mysql-workbench-community-8.0.15-org/library/forms/swig/CMakeLists.txt	2019-01-30 15:32:36.000000000 +0200
+++ mysql-workbench-community-8.0.15-src/library/forms/swig/CMakeLists.txt	2019-02-16 13:56:53.711465800 +0200
@@ -91,7 +91,7 @@
 
 set(SOURCE_FILE_COMPILE_FLAGS "-Wno-missing-field-initializers -Wno-parentheses")
 if(CMAKE_COMPILER_IS_GNUCXX)
-  set(SOURCE_FILE_COMPILE_FLAGS "${SOURCE_FILE_COMPILE_FLAGS} -Wno-maybe-uninitialized -Wno-stringop-truncation -Wno-cast-function-type")
+  set(SOURCE_FILE_COMPILE_FLAGS "${SOURCE_FILE_COMPILE_FLAGS} -Wno-maybe-uninitialized -Wno-stringop-truncation -Wno-cast-function-type -Wno-error=stringop-overflow= ")
 endif()
 
 set_source_files_properties(${swig_generated_file_fullname} PROPERTIES COMPILE_FLAGS ${SOURCE_FILE_COMPILE_FLAGS})