From d788ccb1309069286fc2e3ca0355a2a480b65986 Mon Sep 17 00:00:00 2001 From: Marvin Liu Date: Thu, 19 Mar 2015 11:16:56 +0800 Subject: [PATCH] app/test: fix build constructor with gcc < 4.4 MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Build app/test will be failed for function only defined but not used. test_prefetch.c:65: error: ‘testfn_prefetch_cmd’ defined but not used Add attribute used in test function declaration can fix this. static void __attribute__((used)) testfn_##t(void); Fixes: 727909c59231 ("app/test: introduce dynamic commands list") Signed-off-by: Marvin Liu --- app/test/test.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test/test.h b/app/test/test.h index 545098674a..62eb51db3d 100644 --- a/app/test/test.h +++ b/app/test/test.h @@ -169,7 +169,7 @@ struct test_command { void add_test_command(struct test_command *t); #define REGISTER_TEST_COMMAND(t) \ -static void testfn_##t(void);\ +static void __attribute__((used)) testfn_##t(void);\ void __attribute__((constructor, used)) testfn_##t(void)\ {\ add_test_command(&t);\ -- 2.20.1