From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bruce Richardson Subject: [PATCH 1/2] testpmd: fix out-of-range compiler error Date: Mon, 1 Dec 2014 11:38:54 +0000 Message-ID: <1417433935-29181-2-git-send-email-bruce.richardson@intel.com> References: <1417433935-29181-1-git-send-email-bruce.richardson@intel.com> To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <1417433935-29181-1-git-send-email-bruce.richardson-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" The definition value for IPPROTO_DIVERT protocol uses a value which is out of range of the uint8_t type, giving clang compiler errors on FreeBSD. app/test-pmd/icmpecho.c:231:7: fatal error: overflow converting case value to switch condition type (258 to 2) [-Wswitch] case IPPROTO_DIVERT: /**< divert pseudo-protocol */ This is fixed by having the code to return the protocol name use the uint16_t type for the protocol value input. Signed-off-by: Bruce Richardson --- app/test-pmd/icmpecho.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c index c25a54b..08ea01d 100644 --- a/app/test-pmd/icmpecho.c +++ b/app/test-pmd/icmpecho.c @@ -88,7 +88,7 @@ arp_op_name(uint16_t arp_op) } static const char * -ip_proto_name(uint8_t ip_proto) +ip_proto_name(uint16_t ip_proto) { static const char * ip_proto_names[] = { "IP6HOPOPTS", /**< IP6 hop-by-hop options */ -- 2.1.0