Skip to content

Fix CMake 4 and GCC 15 - #80

Merged
Totktonada merged 2 commits into
masterfrom
Totktonada/gh-79-fix-cmake-4-and-gcc-15
Oct 23, 2026
Merged

Totktonada merged 2 commits into
masterfrom
Totktonada/gh-79-fix-cmake-4-and-gcc-15

Conversation

@Totktonada

Copy link
Copy Markdown
Contributor

See details in the commit messages.

Drafted by an LLM, conducted and corrected by the commit author.

Fixes #79

driver.c calls strcmp() without including string.h. GCC 14 turned an
implicit function declaration into an error [1]:

 | .../mysql/driver.c:647:29: error: implicit declaration of function
 |     'strcmp' [-Wimplicit-function-declaration]

[1]: https://gcc.gnu.org/gcc-14/porting_to.html#implicit-function-declaration

Drafted by an LLM, conducted and corrected by the commit author.

Part of #79
The bundled connector fails to configure with CMake 4.0+: it requires
CMake 2.8 and sets policies to OLD behavior, and CMake 4.0 removed
both [1]:

 | CMake Error at mariadb-connector-c/CMakeLists.txt:5
 |     (CMAKE_MINIMUM_REQUIRED):
 |   Compatibility with CMake < 3.5 has been removed from CMake.
 | <...>
 | CMake Error at mariadb-connector-c/CMakeLists.txt:13 (CMAKE_POLICY):
 |   Policy CMP0026 may not be set to OLD behavior because this version
 |   of CMake no longer supports it.

It also fails to compile with GCC 15, which defaults to C23, where
`bool` is a keyword [2]:

 | .../include/ma_global.h:722:25: error: 'bool' cannot be defined via
 |     'typedef'

Ubuntu 26.04 ships both. The submodule update brings the upstream fixes
for these problems and a C23 fix for the io wait callback, which only
the fork has.

[1]: https://cmake.org/cmake/help/v4.0/release/4.0.html#deprecated-and-removed-features
[2]: https://gcc.gnu.org/gcc-15/porting_to.html#c23-new-keywords

Drafted by an LLM, conducted and corrected by the commit author.

Fixes #79
@Totktonada
Totktonada merged commit 5ffd5f7 into master Oct 23, 2026
1 check passed
@Totktonada
Totktonada deleted the Totktonada/gh-79-fix-cmake-4-and-gcc-15 branch October 23, 2026 00:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support CMake 4 and GCC 15

1 participant