Bug #95585 Compilation errors with gcc 9.1.1
Submitted: 31 May 2019 8:57 Modified: 7 Jun 2019 16:46
Reporter: Dyre Tjeldvoll Email Updates:
Status: Closed Impact on me:
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: CPU Architecture:Any

[31 May 2019 8:57] Dyre Tjeldvoll
gcc 9.1.1 reports new warnings (comparison of signed and unsigned) which are treated as errors in debug builds.


/export/home/tmp/clones/bug_29169678/router/src/http/src/kdf_pbkdf2.cc: In static member function ‘static std::vector<unsigned char> Pbkdf2::salt()’:
/export/home/tmp/clones/bug_29169678/router/src/http/src/kdf_pbkdf2.cc:53:18: error: comparison of integer expressions of different signedness: ‘std::vector<unsigned char>::size_type’ {aka ‘long unsigned int’} and ‘int’ [-Werror=sign-compare]
   53 |   if (out.size() > std::numeric_limits<int>::max()) {
      |       ~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: all warnings being treated as errors

How to repeat:
Build with gcc 9.1.1 and debug

Suggested fix:
Add explicit casts as necessary.
[7 Jun 2019 16:46] Paul DuBois
Posted by developer:
Fixed in 8.0.18.

Configuration/code cleanup. No changelog entry required.
[21 Jun 2019 8:48] Erlend Dahl
Bug#95840 Compilation with g++ 9.1.1 fails 

was marked as a duplicate.