From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <yliu84x@shecgisg003.sh.intel.com>
Received: from mga11.intel.com (mga11.intel.com [192.55.52.93])
 by dpdk.org (Postfix) with ESMTP id 6DE339AB1
 for <dev@dpdk.org>; Thu, 19 Mar 2015 04:17:18 +0100 (CET)
Received: from orsmga003.jf.intel.com ([10.7.209.27])
 by fmsmga102.fm.intel.com with ESMTP; 18 Mar 2015 20:17:18 -0700
X-ExtLoop1: 1
X-IronPort-AV: E=Sophos;i="5.11,427,1422950400"; d="scan'208";a="542999077"
Received: from shvmail01.sh.intel.com ([10.239.29.42])
 by orsmga003.jf.intel.com with ESMTP; 18 Mar 2015 20:17:17 -0700
Received: from shecgisg003.sh.intel.com (shecgisg003.sh.intel.com
 [10.239.29.90])
 by shvmail01.sh.intel.com with ESMTP id t2J3HFUC024368;
 Thu, 19 Mar 2015 11:17:15 +0800
Received: from shecgisg003.sh.intel.com (localhost [127.0.0.1])
 by shecgisg003.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP id
 t2J3HDHK019489; Thu, 19 Mar 2015 11:17:15 +0800
Received: (from yliu84x@localhost)
 by shecgisg003.sh.intel.com (8.13.6/8.13.6/Submit) id t2J3HDMO019485;
 Thu, 19 Mar 2015 11:17:13 +0800
From: Yong Liu <yong.liu@intel.com>
To: dev@dpdk.org
Date: Thu, 19 Mar 2015 11:16:56 +0800
Message-Id: <1426735018-19411-7-git-send-email-yong.liu@intel.com>
X-Mailer: git-send-email 1.7.4.1
In-Reply-To: <1426735018-19411-1-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: 8bit
Subject: [dpdk-dev] [PATCH 4/6] fix build error in app/test with gcc4.3
X-BeenThere: dev@dpdk.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: patches and discussions about DPDK <dev.dpdk.org>
List-Unsubscribe: <http://dpdk.org/ml/options/dev>,
 <mailto:dev-request@dpdk.org?subject=unsubscribe>
List-Archive: <http://dpdk.org/ml/archives/dev/>
List-Post: <mailto:dev@dpdk.org>
List-Help: <mailto:dev-request@dpdk.org?subject=help>
List-Subscribe: <http://dpdk.org/ml/listinfo/dev>,
 <mailto:dev-request@dpdk.org?subject=subscribe>
X-List-Received-Date: Thu, 19 Mar 2015 03:17:19 -0000

From: Marvin Liu <yong.liu@intel.com>

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);

Signed-off-by: Marvin Liu <yong.liu@intel.com>

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);
 
 #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);\
-- 
1.9.3