Bug #96745 Compile warnings in testclients/mysql_client_test.cc
Submitted: 4 Sep 2019 11:23 Modified: 17 Feb 2021 11:25
Reporter: Alexander Kuleshov Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:8.0.17 OS:Linux
Assigned to: CPU Architecture:Any
Tags: warnings

[4 Sep 2019 11:23] Alexander Kuleshov
Description:
A couple of warning messages occur during compilation of last MySQL server from current master.

All warning messages are related to int and uint comparison:

/home/alex/disk/dev/mysql-server/testclients/mysql_client_test.cc: In function ‘void bind_date_conv(uint, bool)’:
/home/alex/disk/dev/mysql-server/testclients/mysql_client_test.cc:5549:17: warning: comparison of integer expressions of different signedness: ‘uint’ {aka ‘unsigned int’} and ‘int’ [-Wsign-compare]
 5549 |   for (i = 0; i < (int)array_elements(my_bind); i++) {
      |               ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

How to repeat:
Build MySQL from master:

$ CC=clang CXX=clang++ cmake -DENABLE_DOWNLOADS=ON -DEVENT__DISABLE_REGRESS=OFF \
                             -DEVENT__DISABLE_SAMPLES=OFF -DEVENT__DISABLE_TESTS=OFF \
                             -DWITH_BLACKHOLE_STORAGE_ENGINE=OFF -DWITH_DEBUG=ON \
                             -DWITH_FEDERATED_STORAGE_ENGINE=OFF -DWITH_NDBCLUSTER=ON \
                             -DWITH_ROUTER=OFF -DWITH_SYSTEMD=ON ..
$ make
[4 Sep 2019 11:24] Alexander Kuleshov
suggested fix

Attachment: 0001-fix-compile-warnings-in-testclients-mysql_client_tes.patch (text/x-patch), 1.90 KiB.

[4 Sep 2019 11:25] Alexander Kuleshov
The patch with possible fix is attached
[4 Sep 2019 11:34] MySQL Verification Team
Hi Mr. Kuleshov,

Thank you for your bug report.

I think that your report can be verified as a minor bug in compiling.

However, we would be grateful if you would add info on the exact version of your clang, exact compilation options and your OS version.

Thanks in advance.
[4 Sep 2019 11:35] MySQL Verification Team
The sooner you provide us with the info, the sooner will these warnings be fixed.
[4 Sep 2019 11:45] Alexander Kuleshov
> However, we would be grateful if you would add info on the exact version of your clang, exact compilation options and your OS version.

Yes, sure:

$ clang -v
clang version 10.0.0 (git@github.com:llvm/llvm-project.git f7a544bca89c19f29d0abb2a8664b03630fb0889)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /home/alex/disk/dev/llvm-project/build/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
Selected GCC installation: /usr/lib/gcc/x86_64-redhat-linux/9
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Selected multilib: .;@m64

and the same is for clang++.

OS: Fedora 30 amd64
[17 Feb 2021 11:25] Erlend Dahl
This seems to have been fixed in 8.0.20 as a side effect of another change.
[17 Feb 2021 13:26] MySQL Verification Team
Thank you, Erlend ....