The following code doesn't compile:
#include <stdio.h>
#include <malloc.h>
int
main(int argc, char *argv[])
{
struct mallinfo mi;
mi = mallinfo();
return 0;
}
~/ssd/tmp$ gcc t.c
t.c: In function ‘main’:
t.c:8:20: error: storage size of ‘mi’ isn’t known
struct mallinfo mi;
^~
t.c:10:9: warning: implicit declaration of function ‘mallinfo’; did you mean ‘main’? [-Wimplicit-function-declaration]
mi = mallinfo();
^~~~~~~~
main
malloc.h
somewhere ahead of/usr/include/malloc.h
in the compiler's include path (such as/usr/local/include
)?