From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Dichtel Subject: Re: [PATCH 4/4] app: fix build with gcc 4.8 Date: Thu, 12 Sep 2013 17:59:13 +0200 Message-ID: <5231E4D1.2040809@6wind.com> References: <6c57bdadc99eb8febc7344c7dfbbccde8aa42734.1375101416.git.thomas.monjalon@6wind.com> Reply-To: nicolas.dichtel-pdR9zngts4EAvxtiuMwx3w@public.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable To: dev-VfR2kkLFssw@public.gmane.org Return-path: In-Reply-To: <6c57bdadc99eb8febc7344c7dfbbccde8aa42734.1375101416.git.thomas.monjalon-pdR9zngts4EAvxtiuMwx3w@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" Le 29/07/2013 14:44, Thomas Monjalon a =C3=A9crit : > GCC 4.8 was producing this error: > argument to =E2=80=98sizeof=E2=80=99 in =E2=80=98strncmp=E2=80=99 call= is the same expression as the > second source; did you mean to provide an explicit length? > [-Werror=3Dsizeof-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_str= ing.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)) !=3D 0) { > + sizeof(buf)) !=3D 0) { In fact, it seems you can use strcmp() instead of strncmp(). Or, if the=20 intention was really to check the length, use strlen(), but this one will= not=20 include the last '\0'.