mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Robert P. J. Day" <rpjday@crashcourse.ca>
To: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: duplicated include files
Date: Sun, 4 Nov 2007 13:37:31 -0500 (EST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0711041334590.5541@localhost.localdomain> (raw)
In-Reply-To: <20071104100724.518cf6c9.randy.dunlap@oracle.com>

On Sun, 4 Nov 2007, Randy Dunlap wrote:

> On Sun, 4 Nov 2007 12:31:38 -0500 (EST) Robert P. J. Day wrote:
>
> >
> >   given the recent patches to remove duplicated #include preprocessor
> > directives in source files, let it be known that there are a number of
> > them:
> >
> >   http://www.crashcourse.ca/wiki/index.php/Duplicate_include_files
> >
> > help yourself.
>
> Could you make the tool (script?) available also, please?

trust me, it's not a script i'm particularly proud of:

===========================
#!/bin/sh

DIR=${1-*}              # by default, all directories

for cf in $(find ${DIR} -name *.c) ; do
        echo ${cf}
        grep "#include" $cf | sort | uniq -c | grep -v 1
done | grep -B1 "#include" | grep -v -- "--"
===========================

  on the bright side, it took about 90 seconds to write, but i won't
be winning any awards for style.

  i'll add it to the web page.

rday
-- 
========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry
Waterloo, Ontario, CANADA

http://crashcourse.ca
========================================================================

  reply	other threads:[~2007-11-04 18:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-04 17:31 Robert P. J. Day
2007-11-04 18:07 ` Randy Dunlap
2007-11-04 18:37   ` Robert P. J. Day [this message]
2007-11-04 18:46     ` Randy Dunlap
2007-11-04 19:03     ` Adrian Bunk
2007-11-04 19:10       ` Robert P. J. Day
2007-11-05  3:02       ` Paul Mundt
2007-11-05  8:27 ` Geert Uytterhoeven
2007-11-04 19:41 Marco Costalba
2007-11-04 19:43 ` Marco Costalba
2007-11-04 19:49   ` Robert P. J. Day
2007-11-04 23:20     ` Jeremy Fitzhardinge
2007-11-05  3:49       ` Robert P. J. Day
2007-11-04 23:43     ` Bernd Petrovitsch
2007-11-04 19:51   ` Randy Dunlap
2007-11-05 10:51 ` Geert Uytterhoeven
2007-11-05 11:38   ` Marco Costalba
2007-11-14 20:40   ` Sam Ravnborg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0711041334590.5541@localhost.localdomain \
    --to=rpjday@crashcourse.ca \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®