From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: [PATCH] devtools: add script to find duplicated includes Date: Mon, 17 Jul 2017 16:01:52 +0300 Message-ID: <3770198.21lzg5AVeE@xps> References: <20170711185546.26138-2-stephen@networkplumber.org> <20170714170707.22464-1-thomas@monjalon.net> <20170717115006.GA20646@hmswarspite.think-freely.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: stephen@networkplumber.org, dev@dpdk.org, keith.wiles@intel.com To: Neil Horman Return-path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 0E0A22C6A for ; Mon, 17 Jul 2017 15:02:01 +0200 (CEST) In-Reply-To: <20170717115006.GA20646@hmswarspite.think-freely.org> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 17/07/2017 14:50, Neil Horman: > On Fri, Jul 14, 2017 at 07:07:07PM +0200, Thomas Monjalon wrote: > > Based on Stephen's idea (originally implemented in a Perl script), > > this is a shell script to find duplicated includes in a file. > > It looks for all the .c and .h files of the git repository. > > > > It is fast enough because automatically well parallelized. > > > > Suggested-by: Stephen Hemminger > > Signed-off-by: Thomas Monjalon > > --- > > devtools/check-dup-includes.sh | 35 +++++++++++++++++++++++++++++++++++ > > 1 file changed, 35 insertions(+) > > create mode 100755 devtools/check-dup-includes.sh > > > How many times has this been a problem? It is not a problem, just a trivial clean-up. > Find the same file included twice in > any single file seems like a pretty rudimentary thing to catch by visual > inspection during development. At the very least I recall coverity having a > header file analyer which would indicate that a header file was unused, and I > think that offered detection of duplicate includes. Good for Coverity. This simple script is Open Source ;)