[MDEV-21978] make my_vsnprintf to use gcc-compatible format extensions (Part-time project) Created: 2020-03-18 Updated: 2022-08-02 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Plugins |
| Fix Version/s: | 11.0 |
| Type: | Task | Priority: | Major |
| Reporter: | Sergei Golubchik | Assignee: | Sergei Golubchik |
| Resolution: | Unresolved | Votes: | 1 |
| Labels: | beginner-friendly, gsoc21, gsoc22 | ||
| Issue Links: |
|
||||||||||||
| Description |
|
my_vsnprintf() is used internally in the server as a portable printf replacement. And it's also exported to plugins as a service. It supports a subset of printf formats and three extensions:
gcc knows printf formats and check whether actual arguments match the format string and issue a warning if they don't. Unfortunately there seems to be no easy way to teach gcc our extensions, so for now we have to disable printf format checks. An better approach would be to use gcc compatible format extensions, like Linux kernel does. We should migrate to a different syntax for our extensions
old formats can still be supported or they can be removed and in the latter case the major version of the service should be increased to signal an incompatible change. All error messages and all usages of my_vsnprintf should be changed to use the new syntax. One way to do it is to disable old syntax conditonally, only in debug builds. All gcc printf format checks should be enabled. |
| Comments |
| Comment by Daniel Black [ 2021-12-16 ] |
|
wlad suggested %lluH , for Humanized formatting ( |
| Comment by Lin, Cheng-Chieh [ 2022-04-12 ] |
|
Hi, I'm a senior student of CSIE department of Cheng Kung University. I saw this task from Google Summer of Code 2022. I'm interested in this task but I haven't used or built MariaDB before. Can I assign this task? |
| Comment by Sergei Golubchik [ 2022-04-26 ] |
|
blueskyson, the "Assignee" field in Jira can only be assigned to someone in a Developers group. But it doesn't matter much. If you'd like to do this task — please, by all means, do it, create a pull request, and pay no attention to the "Assignee" field. |
| Comment by Lin, Cheng-Chieh [ 2022-07-05 ] |
|
Sorry I'm too busy on my work now. Maybe other people can do this task. |