DPDK patches and discussions
 help / color / mirror / Atom feed
From: Nicolas Dichtel <nicolas.dichtel@6wind.com>
To: dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH 4/4] app: fix build with gcc 4.8
Date: Thu, 12 Sep 2013 17:59:13 +0200	[thread overview]
Message-ID: <5231E4D1.2040809@6wind.com> (raw)
In-Reply-To: <6c57bdadc99eb8febc7344c7dfbbccde8aa42734.1375101416.git.thomas.monjalon@6wind.com>

Le 29/07/2013 14:44, Thomas Monjalon a écrit :
> GCC 4.8 was producing this error:
> 	argument to ‘sizeof’ in ‘strncmp’ call is the same expression as the
> 	second source; did you mean to provide an explicit length?
> 	[-Werror=sizeof-pointer-memaccess]
>
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
>   app/test/test_cmdline_string.c |    2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/app/test/test_cmdline_string.c b/app/test/test_cmdline_string.c
> index 7b358cf..84a82ce 100644
> --- a/app/test/test_cmdline_string.c
> +++ b/app/test/test_cmdline_string.c
> @@ -383,7 +383,7 @@ test_parse_string_valid(void)
>   			return -1;
>   		}
>   		if (strncmp(buf, string_elt_strs[i].result,
> -				sizeof(string_elt_strs[i].result)) != 0) {
> +				sizeof(buf)) != 0) {
In fact, it seems you can use strcmp() instead of strncmp(). Or, if the 
intention was really to check the length, use strlen(), but this one will not 
include the last '\0'.

  reply	other threads:[~2013-09-12 15:58 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-29 12:44 [dpdk-dev] [PATCH 0/4] build fixes for recent distros Thomas Monjalon
2013-07-29 12:44 ` [dpdk-dev] [PATCH 1/4] kni: fix build with kernel 3.8 Thomas Monjalon
2013-09-12 15:30   ` Nicolas Dichtel
2013-07-29 12:44 ` [dpdk-dev] [PATCH 2/4] kni: fix build with kernel 3.9 Thomas Monjalon
2013-09-12 15:34   ` Nicolas Dichtel
2013-09-16 13:09     ` Thomas Monjalon
2013-07-29 12:44 ` [dpdk-dev] [PATCH 3/4] kni: fix build with kernel 3.10 Thomas Monjalon
2013-09-12 16:09   ` Nicolas Dichtel
2013-09-16 13:09     ` Thomas Monjalon
2013-07-29 12:44 ` [dpdk-dev] [PATCH 4/4] app: fix build with gcc 4.8 Thomas Monjalon
2013-09-12 15:59   ` Nicolas Dichtel [this message]
2013-09-13 14:14 ` [dpdk-dev] [PATCH v2 0/4] build fixes for recent distros Thomas Monjalon
2013-09-13 14:14   ` [dpdk-dev] [PATCH v2 1/4] kni: fix build with kernel 3.8 Thomas Monjalon
2013-09-16 11:21     ` Nicolas Dichtel
2013-09-13 14:14   ` [dpdk-dev] [PATCH v2 2/4] kni: fix build with kernel 3.9 Thomas Monjalon
2013-09-13 14:14   ` [dpdk-dev] [PATCH v2 3/4] kni: fix build with kernel 3.10 Thomas Monjalon
2013-09-13 14:14   ` [dpdk-dev] [PATCH v2 4/4] app: fix build with gcc 4.8 Thomas Monjalon
2013-09-16 11:22     ` Nicolas Dichtel
2013-09-16 13:10       ` 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=5231E4D1.2040809@6wind.com \
    --to=nicolas.dichtel@6wind.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).