From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wi0-f176.google.com (mail-wi0-f176.google.com [209.85.212.176]) by dpdk.org (Postfix) with ESMTP id B4931A6A for ; Mon, 23 Mar 2015 12:47:35 +0100 (CET) Received: by wibgn9 with SMTP id gn9so59746240wib.1 for ; Mon, 23 Mar 2015 04:47:35 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:in-reply-to:references:mime-version :content-transfer-encoding:content-type; bh=dNxzY2ULm2yrWQ1bSDpDAMk+0CGB6plcI53AwcgxAQ8=; b=MvjN/1C+kG64va0QEULnTv7HnvBfWlPofj0hyvOUs1dsOHqHCdge5r2IYaVyzpJtb2 mQdbLpxSKslyzq7HMf3ipJH65pHHwu7cN2lk286HmkGT5AB0LcyL9Ubrbg5LU7gZlWMF hTI41pfyYYrMl0zpcldsJFa/jp6CXwlysH5Px2xoL/Y0NiHcPjFtHsSiOLuWVONeVNIO x22PeGHwoRKAwRIkRzM5YiykxePK7KHTq4Lt/1Z0uD0hLBcM/GT4YYg9ht22GADa2JPm 4E3lAj9agzhEq9L55lf6B2lNeCRENkP41fnis8iPWks7mbXfYW+5NfmeJjmENkWVdlFd IUYQ== X-Gm-Message-State: ALoCoQmH9qsuIOFBESImlWhCTbnaIL378uVLI2Dv5HCZw2KbXbJaHKNmCNmyLi/2RcRk10V56tFT X-Received: by 10.194.5.37 with SMTP id p5mr186222677wjp.20.1427111255598; Mon, 23 Mar 2015 04:47:35 -0700 (PDT) Received: from xps13.localnet (136-92-190-109.dsl.ovh.fr. [109.190.92.136]) by mx.google.com with ESMTPSA id hn8sm10754302wib.18.2015.03.23.04.47.34 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Mar 2015 04:47:34 -0700 (PDT) From: Thomas Monjalon To: Daniel Mrzyglod Date: Mon, 23 Mar 2015 12:46:54 +0100 Message-ID: <2042259.HzLBmuaM6Z@xps13> Organization: 6WIND User-Agent: KMail/4.14.4 (Linux/3.18.4-1-ARCH; KDE/4.14.4; x86_64; ; ) In-Reply-To: <54EC5A9C.3060008@6wind.com> References: <1424449085-82466-1-git-send-email-danielx.t.mrzyglod@intel.com> <54EC5A9C.3060008@6wind.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Cc: dev@dpdk.org Subject: Re: [dpdk-dev] [PATCH] cmdline: fix type format from unsigned to size_t for buffer size X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Mar 2015 11:47:35 -0000 Daniel, Without answer to the question from Olivier, this patch is going to be ignored. 2015-02-24 12:03, Olivier MATZ: > Hi Daniel, > > On 02/20/2015 05:18 PM, Daniel Mrzyglod wrote: > > Function match_inst is used to take buffor using sizeof() which is size_t type. > > This modification also involved changing '%u' to '%zu' in printf function. > > > > Signed-off-by: Daniel Mrzyglod > > --- > > lib/librte_cmdline/cmdline_parse.c | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git a/lib/librte_cmdline/cmdline_parse.c b/lib/librte_cmdline/cmdline_parse.c > > index dfc885c..0821791 100644 > > --- a/lib/librte_cmdline/cmdline_parse.c > > +++ b/lib/librte_cmdline/cmdline_parse.c > > @@ -138,7 +138,7 @@ nb_common_chars(const char * s1, const char * s2) > > */ > > static int > > match_inst(cmdline_parse_inst_t *inst, const char *buf, > > - unsigned int nb_match_token, void *resbuf, unsigned resbuf_size) > > + unsigned int nb_match_token, void *resbuf, size_t resbuf_size) > > { > > unsigned int token_num=0; > > cmdline_parse_token_hdr_t * token_p; > > @@ -169,7 +169,7 @@ match_inst(cmdline_parse_inst_t *inst, const char *buf, > > > > if (token_hdr.offset > resbuf_size) { > > printf("Parse error(%s:%d): Token offset(%u) " > > - "exceeds maximum size(%u)\n", > > + "exceeds maximum size(%zu)\n", > > __FILE__, __LINE__, > > token_hdr.offset, resbuf_size); > > return -ENOBUFS; > > > > > Did you see a specific issue with the current code? (maybe a compilation > issue or a klocwork issue?) > > I think this patch is ok, but there are many places where this kind > of fixes should be applied in cmdline (cmdline_parse_*(), > cmdline_get_help_*(), etc.). Is there a motivation for changing it > only there? > > Regards, > Olivier >