From: Bruce Richardson <bruce.richardson@intel.com>
To: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 1/2] testpmd: fix out-of-range compiler error
Date: Mon, 1 Dec 2014 11:38:54 +0000 [thread overview]
Message-ID: <1417433935-29181-2-git-send-email-bruce.richardson@intel.com> (raw)
In-Reply-To: <1417433935-29181-1-git-send-email-bruce.richardson@intel.com>
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 <bruce.richardson@intel.com>
---
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
next prev parent reply other threads:[~2014-12-01 11:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-01 11:38 [dpdk-dev] [PATCH 0/2] Fix clang compilation on FreeBSD Bruce Richardson
2014-12-01 11:38 ` Bruce Richardson [this message]
2014-12-01 11:38 ` [dpdk-dev] [PATCH 2/2] testpmd: fix macro check for little endian Bruce Richardson
2014-12-01 15:57 ` [dpdk-dev] [PATCH 0/2] Fix clang compilation on FreeBSD Thomas Monjalon
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1417433935-29181-2-git-send-email-bruce.richardson@intel.com \
--to=bruce.richardson@intel.com \
--cc=dev@dpdk.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).