From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by dpdk.org (Postfix) with ESMTP id 9E3521F3 for ; Thu, 12 Sep 2013 17:58:38 +0200 (CEST) Received: by mail-wi0-f173.google.com with SMTP id hq15so3769080wib.6 for ; Thu, 12 Sep 2013 08:59:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:reply-to:organization :user-agent:mime-version:to:subject:references:in-reply-to :content-type:content-transfer-encoding; bh=napkwfghGr/Nh2wCAYAYuipBTyFdPQmKcDlK1vgTw/Q=; b=bhEK8PusLcyir903L5kkECID0EIjTvHmPhAWpEt3843BDMpaJYsuvLDnYcjgpMoQD7 cAEbAQvOZtBBMfUU6ljomb7g+4i6DfA3OMiOg89YMNB/McFV7Uiu/d2rPOcTFcv+7o+1 9EbqL8faI7U3EYy+ZpavvunVvjHpaba/g38+9zo/EMw54C3EG9XPs2FMs4Em0EnR6lMk ViDIE+9nCCHGtyOuvWEatUxiUFZPXhbwmK/Y+rwvx9jwpGYONTjoV6+MB4O949Sx++mr aT3zJPbLLITKrPVmgM9DsYkNWrspmvj232XS4r3zZfxeFTeiMsc+sPQbaa/uTyWK6yqp gw6Q== X-Gm-Message-State: ALoCoQkJ7IbGvyCI7oO6VBL64k02oYRP7U8VwECYeKi90jkoYOFnOWfUgDAPSE+I+ZGkpXwvd0M7 X-Received: by 10.180.12.243 with SMTP id b19mr6506719wic.18.1379001555359; Thu, 12 Sep 2013 08:59:15 -0700 (PDT) Received: from ?IPv6:2a01:e35:8b63:dc30:d69:d95f:3031:7586? ([2a01:e35:8b63:dc30:d69:d95f:3031:7586]) by mx.google.com with ESMTPSA id l9sm18685702wif.10.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 12 Sep 2013 08:59:14 -0700 (PDT) Message-ID: <5231E4D1.2040809@6wind.com> Date: Thu, 12 Sep 2013 17:59:13 +0200 From: Nicolas Dichtel Organization: 6WIND User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 MIME-Version: 1.0 To: dev@dpdk.org References: <6c57bdadc99eb8febc7344c7dfbbccde8aa42734.1375101416.git.thomas.monjalon@6wind.com> In-Reply-To: <6c57bdadc99eb8febc7344c7dfbbccde8aa42734.1375101416.git.thomas.monjalon@6wind.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [dpdk-dev] [PATCH 4/4] app: fix build with gcc 4.8 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list Reply-To: nicolas.dichtel@6wind.com List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Sep 2013 15:58:38 -0000 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 > --- > 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'.