mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Olaf Dietsche <olaf.dietsche--list.linux-kernel@exmail.de>
To: vda@port.imtp.ilyichevsk.odessa.ua
Cc: linux-kernel@vger.kernel.org
Subject: Re: Extern variables in *.c files (maintainers pls read this)
Date: 04 Jan 2002 00:14:54 +0100	[thread overview]
Message-ID: <87zo3vyqkx.fsf@tigram.bogus.local> (raw)
In-Reply-To: <02010216180403.01928@manta> <3C340EA9.FE084B4C@zip.com.au> <20020103095742.A11443@flint.arm.linux.org.uk> <200201032028.g03KSsE29484@Port.imtp.ilyichevsk.odessa.ua>

"vda@port.imtp.ilyichevsk.odessa.ua"  <vda@port.imtp.ilyichevsk.odessa.ua> writes:

> And this method is traditional for C. We have struct declarations and fn 
> propotypes in *.h, we should place extern vars there too. Always.

Agreed.

> If you are a kernel subsystem or driver maintainer, you may wish to check 
> whether *your* part of kernel has any extern variable defs. Just run this
> hunter script in top dir of kernel source:
> -----------------------
> #!/bin/sh
> 
> function do_grep() {
>     pattern="$1"
>     dir="$2"
>     shift;shift
>     
>     for i in $dir/$*; do
>         if ! test -d "$i"; then
>             if test -e "$i"; then
> 		grep -E "$pattern" "$i" /dev/null
> 	    fi
>         fi
>     done
>     for i in $dir/*; do
>         if test -d "$i"; then
> 	    do_grep "$pattern" "$i" $*
> 	fi
>     done
> }
> 
> do_grep 'extern [^()]*;' . "*.c" 2>&1 | tee ../extern.log
> ---------------------------------

FWIW, I suppose you meant:
$ find . -name '*.c' | xargs grep -E 'extern [^()]*;' 2>&1 | tee extern.log

Regards, Olaf.

      reply	other threads:[~2002-01-03 23:15 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-02 18:18 Extern variables in *.c files vda
2002-01-02 19:24 ` Oliver Xymoron
2002-01-02 21:43   ` Andrew Morton
2002-01-02 22:07     ` Momchil Velikov
2002-01-03  7:19       ` Andrew Morton
2002-01-03  7:42         ` H . J . Lu
2002-01-03  7:56           ` Andrew Morton
2002-01-03  8:24             ` Keith Owens
2002-01-03  9:57             ` Russell King
2002-01-04  0:28               ` Extern variables in *.c files (maintainers pls read this) vda
2002-01-03 23:14                 ` Olaf Dietsche [this message]

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=87zo3vyqkx.fsf@tigram.bogus.local \
    --to=olaf.dietsche--list.linux-kernel@exmail.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vda@port.imtp.ilyichevsk.odessa.ua \
    /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

Powered by JetHome