[dpdk-dev] [PATCH] devtools: add script to find duplicated includes

Neil Horman nhorman at tuxdriver.com
Mon Jul 17 13:50:06 CEST 2017


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 <stephen at networkplumber.org>
> Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
> ---
>  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?  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.  

Neil



More information about the dev mailing list