Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warning: 'mallinfo' is deprecated (memory_usage.cc) #1513

Closed
cz4rs opened this issue Jul 28, 2021 · 1 comment · Fixed by #1798
Closed

warning: 'mallinfo' is deprecated (memory_usage.cc) #1513

cz4rs opened this issue Jul 28, 2021 · 1 comment · Fixed by #1798
Assignees

Comments

@cz4rs
Copy link
Contributor

cz4rs commented Jul 28, 2021

Describe the bug
After upgrading to Ubuntu 21.04 and clang 12, following warning appears during compilation:
/vt/src/vt/utils/memory/memory_usage.cc:149:26: warning: 'mallinfo' is deprecated [-Wdeprecated-declarations]

Compilation line:

 vt  build  /bin/clang++ -DBROTLI_SHARED_COMPILATION -DJSON_USE_IMPLICIT_CONVERSIONS=1 -I../lib/CLI -Idebug -I../src -I../lib/json/include -I../lib/brotli/c/include -I../lib/libfort/lib -I../lib/context/src -Ilib/context -Ilib/checkpoint/src -I../lib/checkpoint/src -I../lib/detector/src -isystem ../lib/fmt/include  -Wall -pedantic -Wshadow -Wno-unknown-pragmas -Wsign-compare -ftemplate-backtrace-limit=100 -fsanitize=undefined  -ftemplate-depth=900 -DCLI11_EXPERIMENTAL_OPTIONAL=0 -g -fcolor-diagnostics -fPIC -std=c++14 -o src/CMakeFiles/vt.dir/vt/utils/memory/memory_usage.cc.o -c /vt/src/vt/utils/memory/memory_usage.cc
/vt/src/vt/utils/memory/memory_usage.cc:149:26: warning: 'mallinfo' is deprecated [-Wdeprecated-declarations]
    struct mallinfo mi = mallinfo();
                         ^
/usr/include/malloc.h:118:48: note: 'mallinfo' has been explicitly marked deprecated here
extern struct mallinfo mallinfo (void) __THROW __MALLOC_DEPRECATED;
                                               ^

glibc version:

 ldd --version 
ldd (Ubuntu GLIBC 2.33-0ubuntu5) 2.33

Expected behavior
Use mallinfo2 instead. See the fix in llvm for reference.

@cz4rs
Copy link
Contributor Author

cz4rs commented May 10, 2022

TODO: re-enable -Werror flag in Ubuntu 22.04 builds after the warning is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant