Skip to contentSkip to conversation

syscalls/mallopt:fix compiling error

PATCH New Xinpeng Liu 2 participants 3 messages Mar 26, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syscalls/mallopt:fix compiling error

mallopt01.c:33:3: warning: implicit declaration of function ?print_mallinfo? [-Wimplicit-function-declaration]

   print_mallinfo("Test uordblks", &info);
      ^

/tmp/ccOU0s7e.o: In function `test_mallopt':
/root/mywork/ltp_github/testcases/kernel/syscalls/mallopt/mallopt01.c:37:
undefined reference to `print_mallinfo' /root/mywork/ltp_github/testcases/kernel/syscalls/mallopt/mallopt01.c:33:
undefined reference to `print_mallinfo'

---
 testcases/kernel/syscalls/mallopt/mallopt01.c | 1 +
 1 file changed, 1 insertion(+)
testcases/kernel/syscalls/mallopt/mallopt01.c +1 -0
index 8ff4649..bb7234f 100644
@@ -13,6 +13,7 @@
  */
 
 
+#define HAVE_MALLINFO
 #include "../mallinfo/mallinfo_common.h"
 #include "tst_safe_macros.h"
 
Signature · 1 line
1.8.3.1
#1 lore raw

PATCH 1/1 syscalls/mallopt:fix compiling error

Hi Liu

Quoted 9 lines

mallopt01.c:33:3: warning: implicit declaration of function ?print_mallinfo? [-Wimplicit-function-declaration]

    print_mallinfo("Test uordblks",&info);
       ^

/tmp/ccOU0s7e.o: In function `test_mallopt':
/root/mywork/ltp_github/testcases/kernel/syscalls/mallopt/mallopt01.c:37:
undefined reference to `print_mallinfo' /root/mywork/ltp_github/testcases/kernel/syscalls/mallopt/mallopt01.c:33:
undefined reference to `print_mallinfo'

Usually, if glibc supports mallopt, it should also support mallinfo. So I guess you met this problem because your compile enviroment wat not clean. Please try again as the following step:
make distclean
make autotools
./configure
cd testcases/kernel/syscalls/mallopt/
make

Quoted 11 lines
---
  testcases/kernel/syscalls/mallopt/mallopt01.c | 1 +
  1 file changed, 1 insertion(+)
testcases/kernel/syscalls/mallopt/mallopt01.c +0 -0
index 8ff4649..bb7234f 100644

testcases/kernel/syscalls/mallopt/mallopt01.c line 16

Quoted 4 lines
testcases/kernel/syscalls/mallopt/mallopt01.c +1 -0
@@ -13,6 +13,7 @@
   */
 
 
+#define HAVE_MALLINFO

We have checked mallinfo function in configure.ac. We never define this directly.

testcases/kernel/syscalls/mallopt/mallopt01.c line 19

Quoted 3 lines
testcases/kernel/syscalls/mallopt/mallopt01.c +0 -0
  #include "../mallinfo/mallinfo_common.h"
  #include "tst_safe_macros.h"
 

Best Regards
Yang Xu

#2 lore raw

PATCH 1/1 syscalls/mallopt:fix compiling error

Thanks,please ignore this patch.

From: [email protected]
Date: 2021-03-26 11:03
To: Xinpeng Liu
CC: [email protected]
Subject: Re: [LTP] [PATCH] syscalls/mallopt:fix compiling error Hi Liu

Quoted 9 lines

mallopt01.c:33:3: warning: implicit declaration of function ?print_mallinfo? [-Wimplicit-function-declaration]

    print_mallinfo("Test uordblks",&info);
       ^

/tmp/ccOU0s7e.o: In function `test_mallopt':
/root/mywork/ltp_github/testcases/kernel/syscalls/mallopt/mallopt01.c:37:
undefined reference to `print_mallinfo' /root/mywork/ltp_github/testcases/kernel/syscalls/mallopt/mallopt01.c:33:
undefined reference to `print_mallinfo'

Usually, if glibc supports mallopt, it should also support mallinfo. So I guess you met this problem because your compile enviroment wat not clean. Please try again as the following step:
make distclean
make autotools
./configure
cd testcases/kernel/syscalls/mallopt/
make

Quoted 11 lines
---
  testcases/kernel/syscalls/mallopt/mallopt01.c | 1 +
  1 file changed, 1 insertion(+)
testcases/kernel/syscalls/mallopt/mallopt01.c +0 -0
index 8ff4649..bb7234f 100644

testcases/kernel/syscalls/mallopt/mallopt01.c line 16

Quoted 4 lines
testcases/kernel/syscalls/mallopt/mallopt01.c +1 -0
@@ -13,6 +13,7 @@
   */
 
 
+#define HAVE_MALLINFO

We have checked mallinfo function in configure.ac. We never define this directly.

testcases/kernel/syscalls/mallopt/mallopt01.c line 19

Quoted 3 lines
testcases/kernel/syscalls/mallopt/mallopt01.c +0 -0
  #include "../mallinfo/mallinfo_common.h"
  #include "tst_safe_macros.h"
 

Best Regards
Yang Xu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20210326/3fc13610/attachment-0001.htm>