Skip to content

Commit bcc175a

Browse files
author
Tor Didriksen
committed
Bug#36480358: Compile MySQL with GCC 14 [noclose 5.7]
Silence warning Wtemplate-id-cdtor, the MySQL 5.7 codebase will never be built with -std=c++20 Also disable Wincompatible-pointer-types when building 'orasdk'. From: Bug #33574176 Compile MySQL with GCC 12 - storage/myisam/ha_myisam.cc:1275:25: error: using a dangling pointer to 'buf' [-Werror=dangling-pointer=] RelWithDebInfo build must be configured with -DCMAKE_CXX_FLAGS="-Wno-maybe-uninitialized -Wno-uninitialized" more warnings from boost and in 'binlog' sources. Change-Id: Id49242553ae4124f17baa716ee95268bc76e9f2d
1 parent 88e448e commit bcc175a

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2006, 2023, Oracle and/or its affiliates.
1+
# Copyright (c) 2006, 2025, Oracle and/or its affiliates.
22
#
33
# This program is free software; you can redistribute it and/or modify
44
# it under the terms of the GNU General Public License, version 2.0,
@@ -712,6 +712,13 @@ IF(CMAKE_COMPILER_IS_GNUCXX AND NOT GXX_VERSION VERSION_LESS 9)
712712
STRING_APPEND(CMAKE_CXX_FLAGS " -Wno-class-memaccess")
713713
ENDIF()
714714

715+
# Modern gcc versions will reject e.g. Bitmap<64>()
716+
# saying it is illegal in C++20
717+
MY_CHECK_CXX_COMPILER_WARNING("-Wtemplate-id-cdtor" HAS_WARN_FLAG)
718+
IF(HAS_WARN_FLAG)
719+
STRING_APPEND(CMAKE_CXX_FLAGS " ${HAS_WARN_FLAG}")
720+
ENDIF()
721+
715722
IF(NOT WITHOUT_SERVER)
716723
SET (MYSQLD_STATIC_PLUGIN_LIBS "" CACHE INTERNAL "")
717724
SET (MYSQLD_STATIC_EMBEDDED_PLUGIN_LIBS "" CACHE INTERNAL "")

storage/myisam/ha_myisam.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright (c) 2000, 2023, Oracle and/or its affiliates.
2+
Copyright (c) 2000, 2025, Oracle and/or its affiliates.
33
44
This program is free software; you can redistribute it and/or modify
55
it under the terms of the GNU General Public License, version 2.0,
@@ -1253,9 +1253,9 @@ int ha_myisam::assign_to_keycache(THD* thd, HA_CHECK_OPT *check_opt)
12531253
/* use all keys if there's no list specified by the user through hints */
12541254
map= table->keys_in_use_for_query.to_ulonglong();
12551255

1256+
char buf[STRING_BUFFER_USUAL_SIZE];
12561257
if ((error= mi_assign_to_key_cache(file, map, new_key_cache)))
12571258
{
1258-
char buf[STRING_BUFFER_USUAL_SIZE];
12591259
my_snprintf(buf, sizeof(buf),
12601260
"Failed to flush to index file (errno: %d)", error);
12611261
errmsg= buf;

0 commit comments

Comments
 (0)