Bug #120794 Compiling MySQL produces warnings
Submitted: 27 Jun 11:54
Reporter: Georgi Kodinov Email Updates:
Status: Open Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:9.7.0 OS:Ubuntu
Assigned to: CPU Architecture:Any

[27 Jun 11:54] Georgi Kodinov
Description:
I get the following warnings while compiling. See the full list into the subsequent comments (too long):

# cmake --build . -j30
[1623/3640] Linking CXX shared library library_output_directory/libmysqlclient.so.24.1.0
/testbed/mysql-server/mysys/crypt_genhash_impl.cc: In function 'my_make_scrambled_password':
/testbed/mysql-server/mysys/crypt_genhash_impl.cc:384:16: warning: '__builtin_strncat' output may be truncated copying between 0 and 20 bytes from a string of length 20 [-Wstringop-truncation]
  384 |   (void)strncat(ctbuffer, (const char *)salt, salt_len);
      |                ^
[3639/3640] Linking CXX executable runtime_output_directory/mysqld
In function 'parse',
    inlined from 'parse' at /testbed/mysql-server/extra/boost/boost_1_87_0/boost/spirit/home/qi/numeric/real.hpp:168:34,
    inlined from 'call' at /testbed/mysql-server/extra/boost/boost_1_87_0/boost/spirit/home/qi/nonterminal/detail/parser_binder.hpp:42:27,
    inlined from 'operator()' at /testbed/mysql-server/extra/boost/boost_1_87_0/boost/spirit/home/qi/nonterminal/detail/parser_binder.hpp:53:24,
    inlined from 'invoke' at /testbed/mysql-server/extra/boost/boost_1_87_0/boost/function/function_template.hpp:79:22:
/testbed/mysql-server/extra/boost/boost_1_87_0/boost/spirit/home/qi/numeric/detail/real_impl.hpp:337:45: warning: 'n' may be used uninitialized [-Wmaybe-uninitialized]
  337 |             traits::assign_to(traits::negate(neg, n), attr);
      |                                             ^
/testbed/mysql-server/extra/boost/boost_1_87_0/boost/spirit/home/qi/numeric/detail/real_impl.hpp: In function 'invoke':
/testbed/mysql-server/extra/boost/boost_1_87_0/boost/spirit/home/qi/numeric/detail/real_impl.hpp:209:15: note: 'n' declared here
  209 |             T n;
      |               ^
In function 'apply',
    inlined from 'apply' at /testbed/mysql-server/extra/boost/boost_1_87_0/boost/geometry/algorithms/detail/disjoint/interface.hpp:97:25,
    inlined from 'apply' at /testbed/mysql-server/extra/boost/boost_1_87_0/boost/geometry/algorithms/detail/disjoint/interface.hpp:129:21,
    inlined from 'disjoint' at /testbed/mysql-server/extra/boost/boost_1_87_0/boost/geometry/algorithms/detail/disjoint/interface.hpp:231:21,
    inlined from 'eval' at /testbed/mysql-server/sql/gis/disjoint.cc:397:22:
/testbed/mysql-server/extra/boost/boost_1_87_0/boost/geometry/algorithms/detail/disjoint/multirange_geometry.hpp:84:21: warning: '<anonymous>' may be used uninitialized [-Wmaybe-uninitialized]
   84 |         return apply(multirange, constant_size_geometry, strategy);

How to repeat:
Compile the server from the public repo (https://github.com/mysql/mysql-server) with "cmake -G Ninja -DWITH_UNIT_TESTS=0 -DWITH_ROUTER=0 -DWITH_NDB=0 -DWITH_NDBCLUSTER=0 -DWITH_NDBCLUSTER_STORAGE_ENGINE=0"

Suggested fix:
Produce no warnings.
[27 Jun 11:56] Georgi Kodinov
full warning list

Attachment: err.txt (text/plain), 0 bytes.