From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f54.google.com (mail-wm0-f54.google.com [74.125.82.54]) by dpdk.org (Postfix) with ESMTP id D37BD2E8A for ; Fri, 13 Jan 2017 18:44:49 +0100 (CET) Received: by mail-wm0-f54.google.com with SMTP id r144so81275971wme.1 for ; Fri, 13 Jan 2017 09:44:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xBa+iIFcl8E2fXDDfC0LmScw0IKNOV7jv8hsnJ7aB04=; b=ZOjbbMGdx87bt7ldvYD6c992aB5VSks/wtd3ggNCaenv0M0iNzQddEkIcLcw4Iq0ez t3TPPg7ikXjv1SkWYtsuchYLTb/QawlkDKwHR/V98m6K1HwfsOtuSsJUTGiKCgip5+G5 CywHqFBpyvHkx+WvfdIQykISikpdkBwzo+EZ9MyLGpt8HgxumZ/3LH/92CTj+XLOsdG/ h/27Q/Ix98fHhzPq2u11PAprdUj3iX9tv9eYzg1IUX4nuogoaawjxSkz0Q5G99nywmWU tFOXy3T0qwfVJRksferOq5IBqPBjFEWsosSWSJaLuGhysHh0WOt1JIGbAbHIQmD+mBc4 4NUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xBa+iIFcl8E2fXDDfC0LmScw0IKNOV7jv8hsnJ7aB04=; b=fnk5eA1kGME5gdSRtMEgTh7aafvjHmSwUlfyznOjGOVS0jYbNPdMr6mvmCnDEIVLIm yZnlD+dSzzwGbsMe0gw3arUlxowCV6QMqHCxZpSo3qNDP2uaCrYwsyLvpiqIWNX5Jmr8 kF4pbcOMIQZ8HabotofhkfegMVmN6QAF0m+twKWddiH+i0L9mvfir6uAqdUh50skGLrV hqzq+KMJg/T49PejRVmfW9QWhtnyMsmy43N6u7+xWxbQCfHU+gfHL1vvYf7B/bT3DJgn fuwbobkNVnCrFoMkepCsIlok7c9Fh6SsvVQuH5ZdYRzH8a77vlo3RsbqTZBDw70tdNgU EqSw== X-Gm-Message-State: AIkVDXJWGsKljXwC1n5ucjBUrkE1cGePNSTpjhEZvGImS6HjC7cs+nC748hwBau6dZC3CGNM X-Received: by 10.28.6.78 with SMTP id 75mr3472711wmg.81.1484329489466; Fri, 13 Jan 2017 09:44:49 -0800 (PST) Received: from platinum (2a01cb0c03c651000226b0fffeed02fc.ipv6.abo.wanadoo.fr. [2a01:cb0c:3c6:5100:226:b0ff:feed:2fc]) by smtp.gmail.com with ESMTPSA id d199sm6022056wmd.0.2017.01.13.09.44.48 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 13 Jan 2017 09:44:49 -0800 (PST) Date: Fri, 13 Jan 2017 18:44:45 +0100 From: Olivier Matz To: Bruce Richardson Cc: dev@dpdk.org Message-ID: <20170113184445.7d719306@platinum> In-Reply-To: <1484237907-30717-1-git-send-email-bruce.richardson@intel.com> References: <1484237907-30717-1-git-send-email-bruce.richardson@intel.com> X-Mailer: Claws Mail 3.14.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] kvargs: make pointers in string arrays const X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jan 2017 17:44:50 -0000 On Thu, 12 Jan 2017 16:18:27 +0000, Bruce Richardson wrote: > Change the parameters of functions from const char *valid[] to > const char * const valid[]. This additional const is needed to > allow us to fix some checkpatch warnings, as well as being good > programming practice. > > For the checkpatch warnings, if we have a set of command line > args that we want to check defined as: > static const char *args[] = { "arg1", "arg2", NULL }; > kvlist = rte_kvargs_parse(params, args); > > checkpatch will complain: > WARNING:STATIC_CONST_CHAR_ARRAY: static const char * > array should probably be static const char * const > > Adding the additional const to the definition of the args > will then trigger a compiler error in the absense of this > change to the kvargs library, as we lose the const in the > call to kvargs_parse. > > Signed-off-by: Bruce Richardson Acked-by: Olivier Matz