mariadb/storage/innobase
Marko Mäkelä f224525204 MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC
The -Wconversion in GCC seems to be stricter than in clang.
GCC at least since version 4.4.7 issues truncation warnings for
assignments to bitfields, while clang 10 appears to only issue
warnings when the sizes in bytes rounded to the nearest integer
powers of 2 are different.

Before GCC 10.0.0, -Wconversion required more casts and would not
allow some operations, such as x<<=1 or x+=1 on a data type that
is narrower than int.

GCC 5 (but not GCC 4, GCC 6, or any later version) is complaining
about x|=y even when x and y are compatible types that are narrower
than int.  Hence, we must rewrite some x|=y as
x=static_cast<byte>(x|y) or similar, or we must disable -Wconversion.

In GCC 6 and later, the warning for assigning wider to bitfields
that are narrower than 8, 16, or 32 bits can be suppressed by
applying a bitwise & with the exact bitmask of the bitfield.
For older GCC, we must disable -Wconversion for GCC 4 or 5 in such
cases.

The bitwise negation operator appears to promote short integers
to a wider type, and hence we must add explicit truncation casts
around them. Microsoft Visual C does not allow a static_cast to
truncate a constant, such as static_cast<byte>(1) truncating int.
Hence, we will use the constructor-style cast byte(~1) for such cases.

This has been tested at least with GCC 4.8.5, 5.4.0, 7.4.0, 9.2.1, 10.0.0,
clang 9.0.1, 10.0.0, and MSVC 14.22.27905 (Microsoft Visual Studio 2019)
on 64-bit and 32-bit targets (IA-32, AMD64, POWER 8, POWER 9, ARMv8).
2020-03-12 19:46:41 +02:00
..
btr MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
buf MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
data MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
dict MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
eval Merge 10.4 into 10.5 2019-12-16 07:47:17 +02:00
fil MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
fsp MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
fts MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
fut MDEV-12353: Change the redo log encoding 2020-02-13 19:12:17 +02:00
gis MDEV-21924 Clean up InnoDB GIS record comparison 2020-03-12 18:13:53 +02:00
ha Cleanup: Aligned InnoDB index page header access 2020-02-08 14:12:59 +02:00
handler MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
ibuf MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
include MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
lock MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
log MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
mem MDEV-15058: Deprecate and ignore innodb_buffer_pool_instances 2020-02-12 14:45:21 +02:00
mtr MDEV-21907: Fix most clang -Wconversion in InnoDB 2020-03-11 08:29:48 +02:00
mysql-test/storage_engine MDEV-20907 Set innodb_log_files_in_group=1 by default 2019-10-28 17:11:10 +02:00
os MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
page MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
pars MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
que fix a memory leak introduced by f4b4284650 2019-12-12 21:29:51 +07:00
read MVCC::view_close(): Correct comments 2019-09-04 09:42:38 +03:00
rem MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
row MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
srv MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
sync MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
trx MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
ut MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
.clang-format add .clang-format file for InnoDB 2019-10-29 21:56:24 +03:00
bzip2.cmake Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
CMakeLists.txt MDEV-15528 Punch holes when pages are freed 2020-03-10 10:51:08 +05:30
compile-innodb
COPYING.Google
COPYING.Percona
innodb.cmake MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
lz4.cmake Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
lzma.cmake Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
lzo.cmake Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
plugin_exports
snappy.cmake Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00