Details
Description
In MDEV-21907, the GCC and clang warning -Wconversion was only enabled for InnoDB and mariadb-backup. If we add #define MYSQL_SERVER to the start of storage/innobase/handler/ha_innodb.cc (to gain access to the internals of THD, for my planned fix of MDEV-37152), then a lot more code will be included the build, and many warnings like the following will be issued:
10.6 2c30f92dd33c4f0315210db0e4fb9a34c0fb9312 |
In file included from /mariadb/10.6/sql/item.h:6603:
|
/mariadb/10.6/sql/item_timefunc.h: In constructor ‘Item_func_now::Item_func_now(THD*, uint)’:
|
/mariadb/10.6/sql/item_timefunc.h:832:15: error: conversion from ‘uint’ {aka ‘unsigned int’} to ‘decimal_digits_t’ {aka ‘short unsigned int’} may change value [-Werror=conversion]
|
832 | { decimals= dec; }
|
| ^~~
|
The data type decimal_digits_t had been introduced in MariaDB Server 10.6.1.
To fix the above example and most other places, we simply need to replace the wider data type alias uint with the narrower decimal_digits_t.
Attachments
Issue Links
- blocks
-
MDEV-26896 Enable -Wconversion globally
-
- Open
-
-
MDEV-37152 buf_page_get_gen -> buf_pool->stat.n_page_gets++ high cpu utilisation
-
- In Progress
-
- relates to
-
MDEV-37478 wait_timeout and interactive_timeout are sometimes 64-bit
-
- Open
-