mariadb/extra
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
..
aws_sdk move aws_sdk to extra/ 2019-02-21 14:48:04 +01:00
crc32-vpmsum compilation failure on ppc with -DCMAKE_BUILD_TYPE=Debug 2019-10-22 09:45:39 +03:00
crc32_armv8_neon Armv8 CRC32 optimization (#772) 2019-05-24 18:20:27 +04:00
mariabackup MDEV-21907: InnoDB: Enable -Wconversion on clang and GCC 2020-03-12 19:46:41 +02:00
readline Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
wolfssl silence a warning in WolfSSL. 2020-01-21 09:20:59 +01:00
charset2html.c Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
CMakeLists.txt Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
comp_err.c cleanup: PSI key is *always* the first argument 2020-03-10 19:24:23 +01:00
innochecksum.cc Merge 10.4 into 10.5 2019-12-16 07:47:17 +02:00
my_print_defaults.c perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
mysql_waitpid.c MDEV-12684 Show what config file a sysvar got a value from 2019-10-14 10:29:30 +02:00
mysqld_safe_helper.c
perror.c Merge 10.4 into 10.5 2019-11-19 10:45:28 +08:00
replace.c perfschema memory related instrumentation changes 2020-03-10 19:24:22 +01:00
resolve_stack_dump.c cleanup: PSI key is *always* the first argument 2020-03-10 19:24:23 +01:00
resolveip.c MDEV-12684 Show what config file a sysvar got a value from 2019-10-14 10:29:30 +02:00