Skip to content

MDEV-35461 Remove redundant checks for standard library functions #4017

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

longjinvan
Copy link

Description

This commit removes function checks for standard library functions that are guaranteed to be available when using C99 standards[1]. These include:

  • ldiv
  • memcpy
  • memmove
  • perror
  • setlocale
  • strcoll
  • strerror
  • strpbrk
  • strtoll
  • strtoul
  • strtoull
  • vsnprintf

All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.

[1] https://www.dii.uchile.cl/~daespino/files/Iso_C_1999_definition.pdf

How can this PR be tested?

✅ Build succeed.
✅ All MTR tests pass.

Basing the PR against the correct MariaDB version

This is a code change related to build performance improvement applicable to multiple versions, and the PR is based against the latest MariaDB development branch.

PR quality check

✅ I have checked the CODING_STANDARDS.md file and my PR conforms to this where appropriate.
✅ For any trivial modifications to the PR, I am ok with the reviewer making the changes themselves.

Remove function checks that are guaranteed by C99 standards to reduce
the excessive time spent during CMake configuration step.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@svoj svoj added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Apr 25, 2025
@svoj
Copy link
Contributor

svoj commented Apr 25, 2025

@vuvova in MDEV-35461 you suggested that these checks should be removed. Which means they have to be removed along with compatibility code spread across other files.

Could you confirm it is still your preference?

@vuvova
Copy link
Member

vuvova commented Apr 26, 2025

Yes, sure, why would we want garbage like #ifdef HAVE_PERROR in the code, when PERROR is always defined?

@svoj svoj self-requested a review April 26, 2025 11:54
Copy link
Contributor

@svoj svoj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please cleanup compatibility code as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.
Development

Successfully merging this pull request may close these issues.

4 participants