Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.5, 10.6, 10.2(EOL), 10.3(EOL), 10.4(EOL)
Description
I think that we should remove the following, rather useless, compile-time check:
diff --git a/storage/innobase/innodb.cmake b/storage/innobase/innodb.cmake
|
index e2e74951f67..b6276f73e31 100644
|
--- a/storage/innobase/innodb.cmake
|
+++ b/storage/innobase/innodb.cmake
|
@@ -228,11 +228,6 @@ ENDIF(NOT MSVC)
|
|
CHECK_FUNCTION_EXISTS(vasprintf HAVE_VASPRINTF)
|
|
-CHECK_CXX_SOURCE_COMPILES("struct t1{ int a; char *b; }; struct t1 c= { .a=1, .b=0 }; main() { }" HAVE_C99_INITIALIZERS)
|
-IF(HAVE_C99_INITIALIZERS)
|
- ADD_DEFINITIONS(-DHAVE_C99_INITIALIZERS)
|
-ENDIF()
|
-
|
SET(MUTEXTYPE "event" CACHE STRING "Mutex type: event, sys or futex")
|
|
IF(MUTEXTYPE MATCHES "event") |
The test program fails to declare a return type, so it should hopefully always fail to compile with a C++ compiler.
Designated initializers were introduced in ISO/IEC 9899:1999 (C99), but the code base is supposed to be compatible with an earlier version of the standard (C90). The InnoDB code based was switched from C to C++ in MySQL 5.6 and MariaDB 10.0.
C++ did not introduce syntax for designated initializers until ISO/IEC 14882:2020. MariaDB Server is still stuck with the 2011 or earlier version of the standard.
Therefore, this check as well as the macro STRUCT_FLD are best removed, to make the declarations easier to read and to slightly reduce the compile time by removing a useless compile-time check.