Skip to content

Conversation

ParadoxV5
Copy link
Contributor

@ParadoxV5 ParadoxV5 commented Sep 3, 2025

  • The Jira issue number for this PR is: MDEV-______

Description

This preprocessor switch is never defined.

The commit history tells that it is for a create_mysqld_error_find_printf_error script, of which I did not find any public mention.
I found one conversation from searching our private Corporation Slack, where Monty shares that he used it to generate include/mysqld_error_find_printf_error.h that surfaces erroneous printfs.

In any case, now that MDEV-21978 (#3360) has (re)enabled -Wformat that activates printf checks built into the compilers, we can use their attributes (e.g., GCC: __attribute__((format(printf, …)))) and should no longer require preprocessing replacements.

Release Notes

N/A
(Brag about dead code removal if you like.)

How can this PR be tested?

Can you please publish your /tmp/my/scripts/create_mysqld_error_find_printf_error, Monty the Great?

PR quality check

  • This is a new feature or a refactoring, and the PR is based against the main branch.
  • This is a bug fix, and the PR is based against the earliest maintained branch in which the bug can be reproduced.
  • I 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.

This preprocessor switch is never defined.

The commit history tells that it is for a
`create_mysqld_error_find_printf_error` script,
of which I did not find any public mention.
I found one conversation from searching our private Corporation Slack,
where Monty shares that he used it to generate `include/
mysqld_error_find_printf_error.h` that surfaces erroneous `printf`s.

In any case, now that MDEV-21978 (#3360) has (re)enabled `-Wformat`
that activates `printf` checks built into the compilers, we can use
their attributes (e.g., GCC: `__attribute__((format(printf, …)))`)
and should no longer require preprocessing replacements.
Copy link
Member

@vuvova vuvova left a comment

Choose a reason for hiding this comment

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

__attribute__((format(printf, …)))) is not quite the same, a compiler cannot check my_error() parameters, because it doesn't know the format string, it's loaded at run time.

that manual process with the create_mysqld_error_find_printf_error script is, of course, totally unmaintainable, I am not sure it was ever run more than once. But simply removing it doesn't solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

2 participants