From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yong Liu Subject: [PATCH 4/6] fix build error in app/test with gcc4.3 Date: Thu, 19 Mar 2015 11:16:56 +0800 Message-ID: <1426735018-19411-7-git-send-email-yong.liu@intel.com> References: <1426735018-19411-1-git-send-email-yong.liu@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1426735018-19411-1-git-send-email-yong.liu-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" From: Marvin Liu Build app/test will be failed for function only defined but not used. test_prefetch.c:65: error: =E2=80=98testfn_prefetch_cmd=E2=80=99 defined = but not used Add attribute used in test function declaration can fix this. static void __attribute__((used)) testfn_##t(void); Signed-off-by: Marvin Liu diff --git a/app/test/test.h b/app/test/test.h index 5450986..62eb51d 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); =20 #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);\ --=20 1.9.3