[MDEV-29683] replace deprecated mallinfo with mallinfo2 Created: 2022-10-03  Updated: 2022-10-03  Resolved: 2022-10-03

Status: Closed
Project: MariaDB Server
Component/s: Server
Fix Version/s: 10.2.38

Type: Task Priority: Minor
Reporter: Eric Herman Assignee: Anel Husakovic
Resolution: Fixed Votes: 0
Labels: None


 Description   

It seems GLibC 2.33 deprecates the mallinfo in favor of mallinfo2. I find reference to it here:

https://gcc.gnu.org/pipermail/gcc-patches/2022-September/601287.html

At a glance the API is similar, I guess some size_t maybe used to be int?

https://man7.org/linux/man-pages/man3/mallinfo2.3.html

Here is the error I see when building:

/home/eric/src/mariadb-server/sql/sql_test.cc: In function ‘void mysql_print_status()’:
/home/eric/src/mariadb-server/sql/sql_test.cc:629:33: error: ‘mallinfo mallinfo()’ is deprecated [-Werror=deprecated-declarations]
  629 |   struct mallinfo info= mallinfo();
      |                         ~~~~~~~~^~
In file included from /home/eric/src/mariadb-server/sql/sql_test.cc:33:
/usr/include/malloc.h:114:24: note: declared here
  114 | extern struct mallinfo mallinfo (void) __THROW __MALLOC_DEPRECATED;
      |                        ^~~~~~~~



 Comments   
Comment by Eric Herman [ 2022-10-03 ]

This looks to have been resolved with commit 48141f3c1787de941d969ad1e6675611b2b650c2

Please close this issue as resolved.

Comment by Anel Husakovic [ 2022-10-03 ]

Fixed with 48141f3c1787de941

Generated at Thu Feb 08 10:10:29 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.