From 30e5069c7d4b51288d3e6f75f53a6ad2f5e71b0f Mon Sep 17 00:00:00 2001 From: Adhemerval Zanella Date: Mon, 31 Aug 2020 11:14:01 -0300 Subject: malloc: Fix mallinfo deprecation declaration It fixes the build issue below introduced by e3960d1c57e57 (Add mallinfo2 function that support sizes >= 4GB). It moves the __MALLOC_DEPRECATED to the usual place for function attributes: In file included from ../include/malloc.h:3, from ../sysdeps/x86_64/multiarch/../../../test-skeleton.c:31, from ../sysdeps/x86_64/multiarch/test-multiarch.c:96: ../malloc/malloc.h:118:1: error: empty declaration [-Werror] 118 | __MALLOC_DEPRECATED; It also adds the required deprecated warning suppression on the tests. Checked on x86_64-linux-gnu. --- malloc/tst-mxfast.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'malloc/tst-mxfast.c') diff --git a/malloc/tst-mxfast.c b/malloc/tst-mxfast.c index 57b4a0a8dc..8afee0f9d5 100644 --- a/malloc/tst-mxfast.c +++ b/malloc/tst-mxfast.c @@ -21,6 +21,7 @@ the fast bins. */ #include +#include #include int @@ -36,8 +37,14 @@ do_test (void) p2 = malloc (512); free (p1); + /* The test below covers the deprecated mallinfo function. */ + DIAG_PUSH_NEEDS_COMMENT; + DIAG_IGNORE_NEEDS_COMMENT (4.9, "-Wdeprecated-declarations"); + m = mallinfo (); + DIAG_POP_NEEDS_COMMENT; + /* This will fail if there are any blocks in the fastbins. */ TEST_COMPARE (m.smblks, 0); -- cgit v1.2.3